140 likes | 166 Views
Component Diagrams. shows the dependencies among software components. Diagrams. Component. component. A component represents a modular, deployable, and replaceable part of a system that encapsulates implementation and exposes a set of interfaces. Implementation classes
E N D
Component Diagrams shows the dependencies among software components
Component component • A component represents a modular, deployable, and replaceable part of a system that encapsulates implementation and exposes a set of interfaces. • Implementation classes • Artifacts such as source code, binaries,scripts,tables…
When to use? • To Model Technical software architecture • Mostly useful with larger teams • During Modeling, to identify high level software components and related interfaces.
Component dependency An interface describes a group of operations used or created by components
Guidelines • Use descriptive names for architectural components • Use environment specific naming conventions for design components. • User.doc, Controller.java, Logger.exe • Apply stereotypes for better understanding. • <<database>>,<<document>>,<<executable>>,<<file>>…… • Avoid modeling data and UI components • Prefer lollipop notation to indicate realization of interfaces. • Show only relevant interfaces • Components should only depend on interfaces. • Follow top-down approach while developing component diagrams
Things to remember.. • Keep component cohesive • It should implement single,related functionality • Assign UI classes to application component. • Use <<application>> stereotype • Assign technical classes to infrastructure components. • Security,persistence,middleware use <<infrastructure>> • Define contracts • Assign hierarchies • Identify domain components • Minimize size of message flow
OCL Way... Additional operations A Component may only contain other Components in its namespace. self.allContents->forAll( c | c.oclIsKindOf(Component)) A Component does not have any Features. self.feature->isEmpty A Component may only have as residents DataTypes, Interfaces, Classes, Associations, Dependencies, Constraints, Signals, DataValues and Objects. self.allResidentElements->forAll( re | re.oclIsKindOf(DataType) or re.oclIsKindOf(Interface) or re.oclIsKindOf(Class) or re.oclIsKindOf(Association) or re.oclIsKindOf(Dependency) or re.oclIsKindOf(Constraint) or re.oclIsKindOf(Signal) or re.oclIsKindOf(DataValue) or re.oclIsKindOf(Object) )
Exercise • Identify components for you current project and draw high level component diagram