Presentation is loading. Please wait.

Presentation is loading. Please wait.

Object Modeling THETOPPERSWAY.COM. Object Modelling Technique(OMT)  Building a model of an application domain and then adding implementation.

Similar presentations


Presentation on theme: "Object Modeling THETOPPERSWAY.COM. Object Modelling Technique(OMT)  Building a model of an application domain and then adding implementation."— Presentation transcript:

1 Object Modeling THETOPPERSWAY.COM

2

3

4

5

6

7 Object Modelling Technique(OMT)  Building a model of an application domain and then adding implementation details to it.  Following four stages:- –Analysis; –System Design; –Object Design; –Implementation.

8 Three Models  Object Model – describes the static structure of objects in the system and their relationships.  Dynamic Model – describes the aspect of the system that change over time, i.e. interaction among objects.  Functional Model – describes data value transformation in the system.

9 Object Model  Describes the structure of objects in a system- - Identity - Relationship to other objects - Their attributes - And their operations.

10 Dynamic Model  Describes those aspects of the system concerned with time and sequencing of operations-  Events that make change  Sequence of events  States that define context of events  And organization of events and states.

11 Functional Model  Describes those aspects of the system concerned with transformation of values-  Functions  Mappings  Constraints  Functional dependencies  Is represented with Data Flow Diagrams.

12 CS 3300 Object-Oriented ConceptsObject-Oriented Modeling Using UML12 Objects and Classes Interpretation in the Real WorldInterpretation in the Model Object An object is a thing that can be distinctly identified. An object has an identity, a state, and a behavior. Class A class represents a set of objects with similar characteristics and behavior. This objects are called the instances of the class. A class characterizes the structure of states and behaviors that are shared by all instances.

13 CS 3300 Object-Oriented Concepts Object-Oriented Modeling Using UML 13 Objects  Each of object has a unique identity.  The state of an object is composed of a set of fields (data fields), or attributes.  Each field has a name, a type, and a value.  Behaviors are defined by methods.  Each method has a name, a type, and a value.  Each method may or may not return a value.  Features are a combination of the state and the behavior of the object.

14 CS 3300 Object-Oriented Concepts Object-Oriented Modeling Using UML 14 Classes  A class defines a template for creating or instantiating its instances or objects.  A class is a description of a set of objects that share the same attributes, operations, relationships, and semantics.

15 CS 3300 Object-Oriented Concepts Object-Oriented Modeling Using UML 15 Example Class name: Point class Point { Fields: x, y int x, y; Method: move public void move (int dx, int dy){ (int dx, int dy){ // implementation // implementation }

16 CS 3300 Object-Oriented ConceptsObject-Oriented Modeling Using UML16 UML Notation for Classes ClassName The top compartment shows the class name. field 1 … field n The middle compartment contains the declarations of the fields of the class. method 1 … method m The bottom compartment contains the declarations of the methods

17 Object Model Notations –Object classes are rectangles with the name at the top, attributes in the middle section and operations in the bottom section;

18 CS 3300 Object-Oriented ConceptsObject-Oriented Modeling Using UML18 UML Notation for Object ObjectName : ClassName The top compartment shows the object name and its class. field 1 = value 1 … field n = value n The bottom compartment contains a list of the fields and their values. objectName -- objectName whose class is of no interest :ClassName -- anonymous object of ClassName which can be identify only through its relationship with other object.

19 CS 3300 Object-Oriented Concepts Object-Oriented Modeling Using UML 19 Examples P1:PointPoint p1 = new Point(); x = 0 y = 0 p1.x = 0; P1.y = 0; P1:PointPoint p1 = new Point(); x = 24 y = 40 p1.x = 24; P1.y = 40;

20 Object Model Notations (Contd.) –Relationships between object classes (known as associations) are shown as lines linking objects

21 Example (Line) L1 (Point) P2 (Point) P1 Intersects (Line) L2 (Line) L3 (Line) L4 Instance Diagram Class Diagram Line name Point name Intersects 2+ L3 L1 L2 L4 P1 P2 Sample Data

22  Connection between objects  Solid line –Direction optional –Arrowhead depends on meaning  Name (optional)  Multiplicities (optional)  Visibility (optional) Associations

23 CS 3300 Object-Oriented Concepts Object-Oriented Modeling Using UML 23 Association  Association represents binary relationship between classes StudentCourse Faculty advisee adviser * enroll teach ** 1 1 *

24 Aggregation  An aggregation model shows how classes that are collections are composed of other classes.  Aggregation models are similar to the part-of relationship in data models.

25 CS 3300 Object-Oriented Concepts Object-Oriented Modeling Using UML 25 Aggregation and Compositon  Aggregation is a special form of association –Has-a or part-whole relationship  Composition is a stronger form of aggregation

26 CS 3300 Object-Oriented Concepts Object-Oriented Modeling Using UML 26 Example UniversityDepartment Faculty Chairman-ofMember-of ** CollegeStudent * 1 11 11 11..*

27 CS 3300 Object-Oriented Concepts Object-Oriented Modeling Using UML 27 Inheritance  Define a relationship among classes and interfaces  Inheritance model -- the is-a(n) relationship

28 CS 3300 Object-Oriented Concepts Object-Oriented Modeling Using UML 28 Example

29 Multiple inheritance

30 Generalization  Models the concept of inheritance  Subclasses inherit the attributes and operations of all their superclasses  Objects of a subclass should be substitutable for objects of their superclasses  Uses hollow triangle arrowhead on superclass

31 Generalisation Example GeneralizationSpecialization

32 Abstract Classes  Used to hold common operations and data  Used in inheritance hierarchy –Derived (child) classes provide implementations  Documented with class name in italics –Can also use {abstract} property Shape {abstract} +move() +erase() : void {abstract} +draw() : void {abstract}

33 Constraints  A restriction in the design  Documented inside curly braces {} attached to any diagram element Window length width {0.5<(length/width)<1.5}

34 Metadata  Data about data.  Data that describes other data.  Metadata is defined as data providing information about one or more aspects of the data, such as: o Means of creation of the data o Purpose of the data o Time and date of creation o Creator or author of data o Location on a computer where the data was created.

35 Candidate Keys  Minimal set of attributes that uniquely identifies an object or link.  It is denoted by braces {C.K.} {Candidate key:(Person, Company)} Person name Company name Works-for

36 THANKS….  THETOPPERSWAY.COM


Download ppt "Object Modeling THETOPPERSWAY.COM. Object Modelling Technique(OMT)  Building a model of an application domain and then adding implementation."

Similar presentations


Ads by Google