I am looking for some examples on UML Class Diagrams for Angular 2 in Typescript.
I am not sure how to define the LifeCycle Hooks within diagram, since on usually uses
export class BlahComponent implements OnInit {
}
and not the word inherits
hence there is no inheritance at least between LifeCycle Hooks and the Class itself.
This also brings up the question if there should be any connection (relation) between Parent-Child Component Classes in UML Diagrams. This comes in lieu, as a Child Component does not inherit
the Parent Component but only expects changes to shared variables between them.
In my opinion, UML Class Diagrams for Angular are usually just classes without any explicit connection to any of the other class components. I would love to have some clarity and examples on this topic.
Implementation
According to the Angular Documentation for onChanges it is an Interface I created an example Diagram as follows
it think from UML 1.4.2[source] onwards Object diagrams are obsolete so as of time being I created <<use>>
tag for showing an instance of class within the class. It is wrong but just as an example here since EventEmitter
according to the Documentation is a class and one tends to use event = new EventEmitter()
in code.
Note
Above figure created using PlantUML which provides methods to change the diagrams accordingly.
OnInit
the diagram showsOnChanges
. But I'd assume the first is an interface too. So the Realize as in the diagram would apply as I assumed. – qwerty_soOnInit
andOnChanges
fall in the same category under Angular hence just an example – Shan-Desai