Advanced Structural Modeling

AMITJain879 4,897 views 24 slides Aug 12, 2020
Slide 1
Slide 1 of 24
Slide 1
1
Slide 2
2
Slide 3
3
Slide 4
4
Slide 5
5
Slide 6
6
Slide 7
7
Slide 8
8
Slide 9
9
Slide 10
10
Slide 11
11
Slide 12
12
Slide 13
13
Slide 14
14
Slide 15
15
Slide 16
16
Slide 17
17
Slide 18
18
Slide 19
19
Slide 20
20
Slide 21
21
Slide 22
22
Slide 23
23
Slide 24
24

About This Presentation

Advanced class & relationship,
Package, Object Diagram


Slide Content

T.Y. B.Sc. (Comp. Sci.) Sem I Object Oriented Software Engineering (OOSE ) CS-336 Faculty Dr. Amit D. Kasliwal Asst. Professor

Chapter 4 Advanced Structural Modeling Overview Advanced classes Advanced Relationship Interface Types and Roles Packages Object Diagram

Advanced Classes In UML, following are the different ways to implement class as a classifier A Classifier is a mechanism that describes structural and behavioral features. Include classes, associations, interfaces, datatypes, signals, components, nodes, use cases and subsystems. A C lass is a description of a set of objects that share the same attributes, operations, relationships, and semantics .

Advanced Classes Interface : c ollection of operations used to specify a service of a class or a component.   Datatype : Including primitive built-in types as well as enumeration types (such as Boolean ). Also immutable.   Association : A description of a set of links, each of which relates two or more objects.   Signal : The specification of an asynchronous message communicated between instances .

Advanced Classes Component : A modular part of a system that hides its implementation behind a set of external interfaces . Node : a physical element that exists at run time and that represents a computational resource, generally having at least some memory and often processing capability.   Use case : A description of a set of a sequence of actions, including variants, that a system performs that yields an observable result of value to a particular actor.   Subsystem A component that represents a major part of a system .

Advanced Classes

Advanced Classes With the advanced classes, we can specify visibility for an attribute or operation in any of four levels. Public : Any outside classifier with visibility to the given classifier can use the feature, specified by the symbol +. Protected : Any descendant of the classifier can use the feature; specified by prepending the symbol #.   Private : Only the classifier itself can use the feature; specified by prepending the symbol -.   Package : Only classifiers declared in the same package can use the feature; specified by prepending the ~ .

Advanced Classes

Interfaces Collection of operations used to specify a service. Specify a behavior of an a element (class or component) independent of its implementation. Important for large scale project where different teams are developing different parts of the system Described by abstract operations (signatures) Used to model the seams (flow) of a system Components on each side of seams should not be affected by changes on the other side

Interfaces Graphical Representation: Or Class Stereotype: <<interface>> Storable load() save() no attribute

Interfaces Relationships Participate in: generalization, association dependency, realization Realization: Class or Component may realize one (or many) interface(s): class provides a set of methods that implement the operations of all the interfaces it realizes Exemple : Sensor Telemetry Filter realization dependency

Types and Roles Types: Same as Interface + Attributes Allow to model the semantics of an abstraction and its conformance to a specific interface. Roles: In a given context, an instance may present only one of its interface. Each interface represents a role the object plays Person Company e:Employee

Packages General purpose mechanism for organizing modeling elements into groups Use Packages for Architecture Views Organize elements semantically close into large chunks Well structured Packages are loosely coupled and very cohesive Graphical Representation: Shape

Packages Package may own other elements classes, interfaces, components, nodes, collaborations, use cases, other packages. Package form namespace (same named element cannot be in same package, but can be in two different packages) Shape Shape + height + length - radius Square Circle Triangle

Packages Visibility Specify whether an element owned by a package can be used by other package : + public: any package that import this package can use the feature # protected: any descendant of the package can use the feature - private: only the elements in the package itself can use the feature Collectively the public parts of a package constitute the package’s interface

Package Example GUI Bus.Obj. DB AppWin AppFrame Facade to Relational Translation SQL Generator Facade Service Control Business Object Entity Business Object

Object Diagram It is a concrete manifestation of an abstraction to which a set of operations can be applied and which has a state that stores the effects of the operations an object in object diagram is rendered by underlining its name in the class symbol

Object Diagram An object has state and therefore it is dynamic . W hen we visualize its state, we are really specifying the value of its state at a given moment in time and space. When we operate on object, we typically change its state; when you query an object, you don't change its state

Object Diagram Model the instances of things contained in class diagrams. Shows a set of objects & their relationships at a point in time. Use to model the static design view or static process view of a system. It is not only important for visualizing, specifying, and documenting structural models, but also for constructing the static aspects of systems. An object diagram covers a set of instances of the things found in a class diagram.

Object Diagram

Object Diagram Commonly contain Objects and Links. Also may contain notes and constraints. We say, If class A has a one-to-many association to class B, then for one instance of A there might be five instances of B; for another instance of A there might be only one instance of B. To model an object diagram, identify the mechanism you'd like to model that should represents some function or behavior of the part of the system you are modeling that results from the interaction of a society of classes, interfaces, and other things Then create a collaboration to describe a mechanism .

Object Diagram To model an object diagram, identify the mechanism you'd like to model that should represents some function or behavior of the part of the system you are modeling that results from the interaction of a society of classes, interfaces, and other things Then create a collaboration to describe a mechanism. For each mechanism, identify the classes, interfaces, and other elements that participate in this collaboration; identify the relationships among these things as well. Expose the state and attribute values of each such object, as necessary, to understand the scenario. Similarly, expose the links among these objects, representing instances of associations among them.

Object Diagram : Example