Module is an object or a class? - chisel

In chisel, we should always extend from 'Module' to define our own module, right?
But, I can only find the definition of 'Module' at 'core/src/main/scala/chisel3/Module.scala' - it's a 'object'! We extend from an object? Or sth I've missed?

When you extend Module the class hierarchy looks like
Module <= abstract class LegacyModule. So it is a class. There is also a object Module that has apply methods that are used differently. BTW, having a good IDE like IntelliJ can make it much easier to navigate class hierarchies and figure out where things are coming from.

Related

React class and className throw errors

A bit of a noobie question here but I have just started working with React and also in a large project and I've noticed that both class and className cannot be used on all elements and components. More specifically, custom components. This has forced me to put the className in a div container but this feels like a bad practice.
This is very strange behavior for me as I am coming from an Angular and Vue background where class or [class] can be placed on most anything and add classes to a component or element
What situations would cause class and className to not be allowed on a component/element in the template?
You can't use class keyword on JSX elements, this is one of few restrictions of jsx.
className error can be caused because of props and types. If you are using className on div, for example and it throws some error, means some package may not be installed, or if you are using react < 17, you forgot to import react module.
Could you be more specific, if you are using typescript and some ui library, like MUI? From what you are saying, it is hard to determine why className causes an error.

Inheritance of component angular 6 templates

We know we can extend an angular component but I would like to also extend the template associated. I mean, for instance, I could define an abstract component with its template with kind of skeleton, and then in the children would be forced to implements not only the abstract class methods and so on, but also the "empty gaps" of the skeleton html template.
Up to now, I have to completely redefine the template in the child.
I know that I could create another component but that a relatioship by association. It's annoying because I have to create an abstract class to be extend and then a component to redefine the template.
How do you do that?
Thank you in advance!
This is not possible. What could be useful to you is content projection
https://blog.angular-university.io/angular-ng-content/

Polymer and globals

I'm getting into Polymer and i like the deps resolution approach using imports.
And i like the extending capability through the behaviors config.
However, there's something that doesn't feel comfortable to me, about behaviors in particular.
Looking at the PolymerElements code i see that behaviors, are defined inside their own html in the global object Polymer and then referenced directly when imported by another component..
For example:
paper-button imports paper-button-behavior
https://github.com/PolymerElements/paper-button/blob/master/paper-button.html#L14
it then defines paper-button-behavior as behavior referencing from global Polymer.PaperButtonBehavior
https://github.com/PolymerElements/paper-button/blob/master/paper-button.html#L144
wich is defined here (the imported html)
https://github.com/PolymerElements/paper-behaviors/blob/master/paper-button-behavior.html#L49
Ain't it an anti-pattern, especially as typically an app will not use Polymer's world exclusively?

phpDoc for object's properties

I've got file template.php, that is included in CBitrixComponentTemplate's method.
CBitrixComponentTemplate has property $this->__component, that is dynamicly filled with object EtmOrderAdd. EtmOrderAdd has property objValidator.
Now, when I am writing the file template.php, I need all these properties to be understood by phpDoc.
Here's the picture, illustrating my idea :
How should I write it?
Bitrix has almost no phpDoc for internal methods and functions. Also it has a plenty of legacy code, that won't show correctly with PhpStorm's code completion.
However, there are several things you can try to improve the situation:
Add bxApiDocs files as an External Library to PhpStorm.
This will add autocomplete for the internal bitrix methods
It seems like you've defined custom component class since $template->__component usually contains CBitrixComponent object that doesn't have objValidator property. So you need to add #property inside your class.php file of your component.

How do you set a "Document class" from an SWC in Flash CS4?

I have an SWC with a class called Content. I want to set it as the "Document Class" in Flash. However, after setting up the SWC in the .fla, I am receiving an error message saying that "A definition for the document class could not be found in the classpath,..." Setting up the direct class folder works fine, but I need to distribute this SWC and do not want to include the sources.
Is it possible to use a class as the Document Class if it resides in an SWC?
I've found some links that seem to indicate no, but I need to find out definitively.
http://balazs.sebesteny.com/document-class-from-swc/
forums.adobe.com/thread/452045
Didn't try it myself. But maybe, if linking directly against the swc doesn't work, a possible workaround could be writting a simple do-nothing class that just extends the class in your swc and have your fla use it as the document class.
Something like:
package {
import your.package.Content;
public class MainClass extends Content {
}
}
confirmed still broken in cs5, and the subclass workaround also still works. i have informed a flash authoring team engineer at adobe. i am attempting to gain support for a fix to this issue here:
http://www.moock.org/blog/archives/000304.html