SlideShare a Scribd company logo
1 of 43
Object Modeling

          OOAD
       MCA 405 C (N2)



           Amandeep S. Patti   1
Objects and Classes
   Object can be a concept, abstraction or
    thing with crisp boundaries and meaning
    for the problem at hand.
   They promote understanding of the real
    world and provide a practical basis for
    computer implementations.



                   Amandeep S. Patti     2
Objects and Classes
   A class describes a group of objects with
    similar properties (attributes), common
    behaviour (operations), common relations
    to other objects and common semantics.
   The objects in a class share a common
    semantic purpose.



                   Amandeep S. Patti       3
Object Diagram
   Object diagram provide a formal graphic
    notation for modeling objects, classes and
    their relationships to one another.
   Object diagrams are useful both for
    abstract modeling and for designing actual
    programs.



                    Amandeep S. Patti       4
Object Diagram
   There are two types of object diagrams.
       A class diagram is a schema, pattern or
        template for describing many possible
        instances of data. A class diagram describes
        object classes.
       An instance diagram describes how a
        particular set of objects relate to each other.
        An instance diagram describes object
        instances.

                        Amandeep S. Patti           5
Attributes
   An attribute is a data value held by the objects in
    a class.
   Each attribute has a value for each object
    instance.
   Different object instances may have same or
    different values for a given attribute.
   Each attribute name is unique within a class.
   An attribute should be a pure data value, not an
    object.

                       Amandeep S. Patti            6
Operations and Methods
Operations
 An operation is a function or transformation that

  may be applied to or by objects in a class.
 Each operation has a target object as an implicit

  argument. The behaviour of the operation
  depends on the class of its target.
 The same operation may apply to many different

  classes.

                    Amandeep S. Patti           7
Operations and Methods
   A method is the implementation of the operation
    for a class.
   An operation may have arguments in addition to
    its target object. Such arguments parameterize
    the operation but do not affect the choice of
    method.
   The method depends only on the class of the
    target object.
   When an operation has methods on several
    classes, it is important that the methods all have
    the same signature.
                       Amandeep S. Patti            8
Notations for Class Diagram
                                         Place the name of the
        Class Name
                                          class in the first
Attribute: Type = Value                   partition      (centered,
                                          bolded, & capitalized),
                                          list the attributes in the
                                          second partition, and
Operation(arg_List): return type
                                          write operations into
                                          the third.


                             Amandeep S. Patti                   9
Links and Associations
   Represent static relationship between
    classes.
   A link is a physical or conceptual
    connection between object instances.
   An association describes a group of links
    with common structure and common
    semantics.

                   Amandeep S. Patti      10
Links and Associations
   All the links in an association connect
    objects from the same classes.
   Both often appear as verbs in a problem
    statement.
   Associations are inherently bi-directional.
   Associations are often implemented in
    programming languages as pointers from
    one object to another.

                    Amandeep S. Patti       11
Links and Associations
1    No more than one                   Company
0..1 Zero or One                             1
*    Many
0..* Zero or Many                            1..*
1..* One or Many                         Person




                    Amandeep S. Patti               12
Multiplicity
   It specifies how many instances of one
    class may relate to a single instance of an
    associated class.
   It constrains the number of related objects.
   It is generally described as being “one” or
    “many”, but it is a subset of non-negative
    integers.
   It depends on assumptions and how you
    define the boundaries of a problem.
                     Amandeep S. Patti       13
Class Name
    Multiplicity              Attribute: Type = Value

                              Operation(arg_List): return type

                                        *       {Constraints}   *
For    example,     one
company will have one or
more employees, but                     1..*                    1
each employee works for
                                            Class Name
one company only.             Attribute: Type = Value

                              Operation(arg_List): return type



                    Amandeep S. Patti                               14
Link Attributes
   A link attribute is a property of the links in
    an association.

                    Accessible by
        File                               User


                    Access permission




                       Amandeep S. Patti          15
Role Names
   A role is an end of an association.
   A binary association has two roles, each of which
    may have a role name.
   A role is a name that uniquely identifies one end
    of an association.
   Role names are necessary for associations
    between two objects of same class.
                 Employee        Employe
      Person           Works-for r         Company

                       Amandeep S. Patti             16
Ordering
   The ordering is an inherent part of the
    association. An ordered set of objects on
    the “many” end of an association is
    indicated by writing “{ordered}” next to the
    multiplicity dot for the role.
   This is a special kind of constraint.
                {Ordered}
       Window                             Screen
                    Visible-on


                      Amandeep S. Patti            17
Qualification
   A qualified association relates two classes
    and a qualifier.
   One to many and many to many
    associations may be qualified.
   The qualifier is a special attribute that
    reduces the effective multiplicity of an
    association.


                    Amandeep S. Patti       18
Qualification
   The qualifier distinguishes among the set
    of objects at the many end of an
    association.
   A qualified association can also be
    considered as ternary association.
    Directory   File                       File
                name




                       Amandeep S. Patti          19
Aggregation
   Aggregation is the “part-whole” or “a-part-of”
    relationship in which objects representing the
    components of something are associated with
    an object representing the entire assembly.
   The aggregate is semantically an extended
    object that is treated as a unit in many
    operations, although physically it is made of
    several objects.

                     Amandeep S. Patti         20
Aggregation
   Aggregation is inherently transitive; An
    aggregate has parts, which may in turn
    have parts.
   Many aggregate operations operate on
    both direct and indirect parts.
   Aggregation can be fixed, variable or
    recursive.

                   Amandeep S. Patti     21
Types of Aggregation
   A fixed aggregate has a fixed structure; The
    types and number of subparts are predefined.
   A variable aggregate has a finite number of
    levels, but the number of parts may vary.
   A recursive aggregate contains directly or
    indirectly, an instance of the same kind of
    aggregate; the no. of potential levels is
    unlimited.

                    Amandeep S. Patti        22
Propagation of Operations
   Propagation is the automatic application of an
    operation to a network of objects when the
    operation is applied to some starting object.
   The propagation behaviour is bound to an
    association, direction and operation.
   Propagation is indicated on object models with a
    small arrow & operation name next to the
    affected association. The arrow indicates the
    direction of propagation.
                      Amandeep S. Patti          23
Generalization
   It is the relationship between a class and
    one or more refined versions of it. The
    class being refined is called the superclass
    and each refined version is called
    subclass.
   It is sometimes called the “is-a” relationship
    because each instance of a subclass is an
    instance of superclass as well.
                     Amandeep S. Patti         24
Generalization
   The notation for generalization is a triangle
    connecting a superclass to its subclasses.
    The superclass is connected by a line to
    the apex of the triangle and the subclasses
    are connected by the line to a horizontal
    bar attached to the base of the triangle.



                     Amandeep S. Patti        25
Generalization                             Figure
                                             Color
                                             Center position
   “Dimensionality”        is               Move
    discriminator.                           select
   It is an attribute of
    enumeration type that                             dimensionality

    indicates which property
                                     One Dim                  Two Dim
    of an object is being
                                  Orientation          Orientation
    abstracted     by        a
                                                       Fill type
    particular generalization
                                  Scale                Scale
    relationship.
                                                       fill


                         Amandeep S. Patti                           26
Generalization, Inheritance and
     Specialization
   Generalization is used to refer to the
    relationship among classes, while inheritance
    refers to the mechanism of sharing attributes
    and operations using the generalization
    relationship.
   Generalization and specialization are two
    different viewpoints of the same relationship,
    viewed from superclass or from the subclass.

                     Amandeep S. Patti         27
Aggregation V/s Generalization
   Aggregation relates instances. Two distinct
    objects are involved; One of them is part of
    other whereas generalization relates
    classes and is a way of structuring the
    description of a single object. Both super
    class and subclass refer to properties of a
    single object.


                    Amandeep S. Patti        28
Aggregation V/s Generalization
   An aggregation tree is composed of object
    instances that are all part of a composite
    object; A generalization tree is composed
    of classes that describe an object.
   Aggregation is often called “a-part-of”
    relationship (sometime called “and-relationship”);
    Generalization is often called “a-kind of” or
    “is-a” relationship (sometime called “or-
    relationship”).

                       Amandeep S. Patti           29
Aggregation v/s Association
   Aggregation is a special form of association,
    not an independent concept.
   Aggregation adds semantic connotations in
    certain cases. If two objects are tightly
    bound by a part-whole relationship, it is an
    aggregation.
   If two objects are independent, and they are
    linked, it is an association.

                     Amandeep S. Patti       30
Abstract class
   An incomplete superclass that defines common
    features to several classes.
   Not instantiated.
   Frequently used to define methods to be
    inherited by subclasses.
   It can define the protocol for an operation
    (abstract operation) without supplying a
    corresponding method, for which each subclass
    must provide its own implementation.

                     Amandeep S. Patti        31
Concrete class
   Is a complete class.
   Describes a concept completely.
   Is intended to be instantiated.
   It may have abstract subclasses (but they in
    turn must have concrete descendants).
   Only concrete classes may be leaf classes
    in the inheritance tree.


                    Amandeep S. Patti        32
Generalization as Extension and
    Restriction
   In generalization, an instance of a class is an
    instance of the class. Therefore all ancestor class
    features must apply to the subclass instances. A
    descendent class cannot omit or suppress an
    ancestor attribute because then it could not truly be
    an ancestor instance. Similarly operations on an
    ancestor class must apply to all descendent classes.
    A subclass may re-implement an operation for
    reasons of efficiency but cannot change the external
    protocol.
   Adding features is called Extension.
   Constraining ancestor attributes is called Restriction.
                         Amandeep S. Patti             33
Overriding Operations
   The mechanism by which a child class can
    provide an alternative implementation of a
    method currently provided by a parent class.
   Overriding for extension: the new operation is the
    same as the inherited operation, except it adds
    some behaviour, usually affecting new attributes
    of the subclass.
   Overriding for restriction: The new operation
    restricts the protocol, such as tightening the
    types of arguments.
                       Amandeep S. Patti           34
Overriding Operations
   Overriding for optimization: An implementation
    can take advantage of the constraints imposed
    by a restriction to improve the code for an
    operation, and it is valid use of overriding.
   Overriding for convenience: A common practice
    in developing new classes is to look for a class
    similar to what is desired. The new class is made
    a subclass of the existing class and overrides the
    methods that are inconvenient. This ad hoc use
    of inheritance is semantically wrong.

                      Amandeep S. Patti            35
Multiple Inheritance
   A class may inherits features from more than one
    superclass. Such class is called a join class.
   A feature from the same ancestor class found
    along more than one path is inherited only once.
   The advantage of multiple inheritance is greater
    power in specifying classes and an increased
    opportunity for reuse. It brings object modeling
    closer to the way people thinks.
   The disadvantage is a loss of conceptual and
    implementation simplicity.
                      Amandeep S. Patti          36
Workarounds
                        Employee



            Employee                               Employee
            Payroll                                Pension




Hourly      Salaried   Exempt                  Vested        Unvested
Employee    Employee   Employee                Employee      Employee

           Multiple Inheritance Using delegation

                           Amandeep S. Patti                        37
Workarounds
                                                     Employee
           Employee
                                                     Pension

 Pay Status
                                                            Pension Status

Hourly        Salaried   Exempt                  Vested        Unvested
Employee      Employee   Employee                Employee      Employee


   Multiple Inheritance using inheritance & delegation




                             Amandeep S. Patti                        38
Metadata
   Data about data.
      Models are inherently metadata.

      Parts catalogs, blue-prints, dictionaries etc.

   Patterns and Metadata




                           Amandeep S. Patti            39
Constraints
   Constraints are functional relationships between
    entities of an object model. The term entity
    includes objects, classes, attributes, links and
    associations.
   A constraint restricts the values that entities can
    assume.
   A good object model captures many constraints
    through its structure.
   Object modeling notation for constraints is as follows: Constraints are
    delimited by braces and positioned near the constrained entity. A
    dotted line connects multiple constrained entities.

                               Amandeep S. Patti                      40
Constraints
  Employe                      Window
  e                        Length
     Salary                width
{Salary <= boss.Salary}   {length > width}

           Constraints on
           objects

                                    {ordered}
 Country         Office                         Person

         Constraints on association
         links
                          Amandeep S. Patti              41
Derived Objects, Links and Attributes
   A derived object is defined as a function of
    one or more objects, which in turn may be
    derived.
   The notation for derived entity is a slash or
    diagonal line (on the corner of a class box, or
    an association line, or in front of an attribute).
Machine                 Assembly                 Part


              offset                    offset   Offset
                         Amandeep S. Patti                42
Homomorphism
                                       Maps                   Contains
     Contains
CatalogItem                                       Item
Model number                                  Serial number
                      Describes

{Item1 contains item2 => item1.model contains item2.model}

     Homomorphism for a parts
     catalog



                        Amandeep S. Patti                          43

More Related Content

What's hot

Overview of UML Diagrams
Overview of UML DiagramsOverview of UML Diagrams
Overview of UML DiagramsManish Kumar
 
Uml Presentation
Uml PresentationUml Presentation
Uml Presentationmewaseem
 
Object and class relationships
Object and class relationshipsObject and class relationships
Object and class relationshipsPooja mittal
 
Object Oriented Approach for Software Development
Object Oriented Approach for Software DevelopmentObject Oriented Approach for Software Development
Object Oriented Approach for Software DevelopmentRishabh Soni
 
Object oriented software engineering concepts
Object oriented software engineering conceptsObject oriented software engineering concepts
Object oriented software engineering conceptsKomal Singh
 
Fundamental design concepts
Fundamental design conceptsFundamental design concepts
Fundamental design conceptssrijavel
 
Spiral model presentation
Spiral model presentationSpiral model presentation
Spiral model presentationSayedFarhan110
 
Software Design and Modularity
Software Design and ModularitySoftware Design and Modularity
Software Design and ModularityDanyal Ahmad
 
Object Oriented Analysis Design using UML
Object Oriented Analysis Design using UMLObject Oriented Analysis Design using UML
Object Oriented Analysis Design using UMLAjit Nayak
 
Major and Minor Elements of Object Model
Major and Minor Elements of Object ModelMajor and Minor Elements of Object Model
Major and Minor Elements of Object Modelsohailsaif
 
Software design principles
Software design principlesSoftware design principles
Software design principlesRitesh Singh
 
INTRODUCTION TO JSP,JSP LIFE CYCLE, ANATOMY OF JSP PAGE AND JSP PROCESSING
INTRODUCTION TO JSP,JSP LIFE CYCLE, ANATOMY OF JSP PAGE  AND JSP PROCESSINGINTRODUCTION TO JSP,JSP LIFE CYCLE, ANATOMY OF JSP PAGE  AND JSP PROCESSING
INTRODUCTION TO JSP,JSP LIFE CYCLE, ANATOMY OF JSP PAGE AND JSP PROCESSINGAaqib Hussain
 
Uml Presentation
Uml PresentationUml Presentation
Uml Presentationanasz3z3
 
5.state diagrams
5.state diagrams5.state diagrams
5.state diagramsAPU
 
Goal based agent
Goal based agentGoal based agent
Goal based agentLamisaFaria
 

What's hot (20)

Functional modeling
Functional modelingFunctional modeling
Functional modeling
 
Overview of UML Diagrams
Overview of UML DiagramsOverview of UML Diagrams
Overview of UML Diagrams
 
Uml Presentation
Uml PresentationUml Presentation
Uml Presentation
 
Object and class relationships
Object and class relationshipsObject and class relationships
Object and class relationships
 
Object Oriented Approach for Software Development
Object Oriented Approach for Software DevelopmentObject Oriented Approach for Software Development
Object Oriented Approach for Software Development
 
State Diagrams
State DiagramsState Diagrams
State Diagrams
 
Waterfall model
Waterfall modelWaterfall model
Waterfall model
 
Software quality assurance
Software quality assuranceSoftware quality assurance
Software quality assurance
 
Object oriented software engineering concepts
Object oriented software engineering conceptsObject oriented software engineering concepts
Object oriented software engineering concepts
 
Fundamental design concepts
Fundamental design conceptsFundamental design concepts
Fundamental design concepts
 
Spiral model presentation
Spiral model presentationSpiral model presentation
Spiral model presentation
 
Software Design and Modularity
Software Design and ModularitySoftware Design and Modularity
Software Design and Modularity
 
Object Oriented Analysis Design using UML
Object Oriented Analysis Design using UMLObject Oriented Analysis Design using UML
Object Oriented Analysis Design using UML
 
Major and Minor Elements of Object Model
Major and Minor Elements of Object ModelMajor and Minor Elements of Object Model
Major and Minor Elements of Object Model
 
Software design principles
Software design principlesSoftware design principles
Software design principles
 
INTRODUCTION TO JSP,JSP LIFE CYCLE, ANATOMY OF JSP PAGE AND JSP PROCESSING
INTRODUCTION TO JSP,JSP LIFE CYCLE, ANATOMY OF JSP PAGE  AND JSP PROCESSINGINTRODUCTION TO JSP,JSP LIFE CYCLE, ANATOMY OF JSP PAGE  AND JSP PROCESSING
INTRODUCTION TO JSP,JSP LIFE CYCLE, ANATOMY OF JSP PAGE AND JSP PROCESSING
 
Uml Presentation
Uml PresentationUml Presentation
Uml Presentation
 
5.state diagrams
5.state diagrams5.state diagrams
5.state diagrams
 
Goal based agent
Goal based agentGoal based agent
Goal based agent
 
UML Diagrams
UML DiagramsUML Diagrams
UML Diagrams
 

Similar to Object Modeling Concepts

Ch.03 - Class Diagram_1 OBJECT ORIENTED ANALYSIS AND DESIGN [O] .pptx
Ch.03 - Class Diagram_1 OBJECT ORIENTED ANALYSIS AND DESIGN [O] .pptxCh.03 - Class Diagram_1 OBJECT ORIENTED ANALYSIS AND DESIGN [O] .pptx
Ch.03 - Class Diagram_1 OBJECT ORIENTED ANALYSIS AND DESIGN [O] .pptxSohagSrz
 
Unit 2(advanced class modeling & state diagram)
Unit  2(advanced class modeling & state diagram)Unit  2(advanced class modeling & state diagram)
Unit 2(advanced class modeling & state diagram)Manoj Reddy
 
OMD chapter 2 Class modelling
 OMD  chapter 2 Class modelling OMD  chapter 2 Class modelling
OMD chapter 2 Class modellingjayashri kolekar
 
OO Development 4 - Object Concepts
OO Development 4 - Object ConceptsOO Development 4 - Object Concepts
OO Development 4 - Object ConceptsRandy Connolly
 
Introduction to UML
Introduction to UMLIntroduction to UML
Introduction to UMLyndaravind
 
SE18_Lec 06_Object Oriented Analysis and Design
SE18_Lec 06_Object Oriented Analysis and DesignSE18_Lec 06_Object Oriented Analysis and Design
SE18_Lec 06_Object Oriented Analysis and DesignAmr E. Mohamed
 
SE_Lec 06_Object Oriented Analysis and Design
SE_Lec 06_Object Oriented Analysis and DesignSE_Lec 06_Object Oriented Analysis and Design
SE_Lec 06_Object Oriented Analysis and DesignAmr E. Mohamed
 
Object Oriented Principles
Object Oriented PrinciplesObject Oriented Principles
Object Oriented PrinciplesEmprovise
 
Object diagram
Object diagramObject diagram
Object diagramRahul Pola
 
08 class and sequence diagrams
08   class and sequence diagrams08   class and sequence diagrams
08 class and sequence diagramskebsterz
 

Similar to Object Modeling Concepts (20)

Object modeling
Object modelingObject modeling
Object modeling
 
Ch.03 - Class Diagram_1 OBJECT ORIENTED ANALYSIS AND DESIGN [O] .pptx
Ch.03 - Class Diagram_1 OBJECT ORIENTED ANALYSIS AND DESIGN [O] .pptxCh.03 - Class Diagram_1 OBJECT ORIENTED ANALYSIS AND DESIGN [O] .pptx
Ch.03 - Class Diagram_1 OBJECT ORIENTED ANALYSIS AND DESIGN [O] .pptx
 
Unit 2(advanced class modeling & state diagram)
Unit  2(advanced class modeling & state diagram)Unit  2(advanced class modeling & state diagram)
Unit 2(advanced class modeling & state diagram)
 
UML
UMLUML
UML
 
OMD chapter 2 Class modelling
 OMD  chapter 2 Class modelling OMD  chapter 2 Class modelling
OMD chapter 2 Class modelling
 
Uml - An Overview
Uml - An OverviewUml - An Overview
Uml - An Overview
 
Interfaces & Packages V2
Interfaces & Packages V2Interfaces & Packages V2
Interfaces & Packages V2
 
Css uml
Css umlCss uml
Css uml
 
Chapter3
Chapter3Chapter3
Chapter3
 
OO Development 4 - Object Concepts
OO Development 4 - Object ConceptsOO Development 4 - Object Concepts
OO Development 4 - Object Concepts
 
Introduction to UML
Introduction to UMLIntroduction to UML
Introduction to UML
 
Jar chapter 2
Jar chapter 2Jar chapter 2
Jar chapter 2
 
SE18_Lec 06_Object Oriented Analysis and Design
SE18_Lec 06_Object Oriented Analysis and DesignSE18_Lec 06_Object Oriented Analysis and Design
SE18_Lec 06_Object Oriented Analysis and Design
 
Erm
ErmErm
Erm
 
Erm
ErmErm
Erm
 
2 class use case
2 class use case2 class use case
2 class use case
 
SE_Lec 06_Object Oriented Analysis and Design
SE_Lec 06_Object Oriented Analysis and DesignSE_Lec 06_Object Oriented Analysis and Design
SE_Lec 06_Object Oriented Analysis and Design
 
Object Oriented Principles
Object Oriented PrinciplesObject Oriented Principles
Object Oriented Principles
 
Object diagram
Object diagramObject diagram
Object diagram
 
08 class and sequence diagrams
08   class and sequence diagrams08   class and sequence diagrams
08 class and sequence diagrams
 

More from Anand Grewal

More from Anand Grewal (12)

distributed dbms
distributed dbmsdistributed dbms
distributed dbms
 
Transaction concurrency control
Transaction concurrency controlTransaction concurrency control
Transaction concurrency control
 
Object analysis and design
Object analysis and designObject analysis and design
Object analysis and design
 
O ops concepts
O ops conceptsO ops concepts
O ops concepts
 
System design
System designSystem design
System design
 
Presentation12
Presentation12Presentation12
Presentation12
 
Presentation1
Presentation1Presentation1
Presentation1
 
Event handling
Event handlingEvent handling
Event handling
 
Isp
IspIsp
Isp
 
Java
JavaJava
Java
 
Pptemail
PptemailPptemail
Pptemail
 
Presentation on dns
Presentation on dnsPresentation on dns
Presentation on dns
 

Recently uploaded

How to Add Barcode on PDF Report in Odoo 17
How to Add Barcode on PDF Report in Odoo 17How to Add Barcode on PDF Report in Odoo 17
How to Add Barcode on PDF Report in Odoo 17Celine George
 
Computed Fields and api Depends in the Odoo 17
Computed Fields and api Depends in the Odoo 17Computed Fields and api Depends in the Odoo 17
Computed Fields and api Depends in the Odoo 17Celine George
 
Inclusivity Essentials_ Creating Accessible Websites for Nonprofits .pdf
Inclusivity Essentials_ Creating Accessible Websites for Nonprofits .pdfInclusivity Essentials_ Creating Accessible Websites for Nonprofits .pdf
Inclusivity Essentials_ Creating Accessible Websites for Nonprofits .pdfTechSoup
 
Earth Day Presentation wow hello nice great
Earth Day Presentation wow hello nice greatEarth Day Presentation wow hello nice great
Earth Day Presentation wow hello nice greatYousafMalik24
 
AMERICAN LANGUAGE HUB_Level2_Student'sBook_Answerkey.pdf
AMERICAN LANGUAGE HUB_Level2_Student'sBook_Answerkey.pdfAMERICAN LANGUAGE HUB_Level2_Student'sBook_Answerkey.pdf
AMERICAN LANGUAGE HUB_Level2_Student'sBook_Answerkey.pdfphamnguyenenglishnb
 
Difference Between Search & Browse Methods in Odoo 17
Difference Between Search & Browse Methods in Odoo 17Difference Between Search & Browse Methods in Odoo 17
Difference Between Search & Browse Methods in Odoo 17Celine George
 
ANG SEKTOR NG agrikultura.pptx QUARTER 4
ANG SEKTOR NG agrikultura.pptx QUARTER 4ANG SEKTOR NG agrikultura.pptx QUARTER 4
ANG SEKTOR NG agrikultura.pptx QUARTER 4MiaBumagat1
 
Roles & Responsibilities in Pharmacovigilance
Roles & Responsibilities in PharmacovigilanceRoles & Responsibilities in Pharmacovigilance
Roles & Responsibilities in PharmacovigilanceSamikshaHamane
 
HỌC TỐT TIẾNG ANH 11 THEO CHƯƠNG TRÌNH GLOBAL SUCCESS ĐÁP ÁN CHI TIẾT - CẢ NĂ...
HỌC TỐT TIẾNG ANH 11 THEO CHƯƠNG TRÌNH GLOBAL SUCCESS ĐÁP ÁN CHI TIẾT - CẢ NĂ...HỌC TỐT TIẾNG ANH 11 THEO CHƯƠNG TRÌNH GLOBAL SUCCESS ĐÁP ÁN CHI TIẾT - CẢ NĂ...
HỌC TỐT TIẾNG ANH 11 THEO CHƯƠNG TRÌNH GLOBAL SUCCESS ĐÁP ÁN CHI TIẾT - CẢ NĂ...Nguyen Thanh Tu Collection
 
Visit to a blind student's school🧑‍🦯🧑‍🦯(community medicine)
Visit to a blind student's school🧑‍🦯🧑‍🦯(community medicine)Visit to a blind student's school🧑‍🦯🧑‍🦯(community medicine)
Visit to a blind student's school🧑‍🦯🧑‍🦯(community medicine)lakshayb543
 
How to do quick user assign in kanban in Odoo 17 ERP
How to do quick user assign in kanban in Odoo 17 ERPHow to do quick user assign in kanban in Odoo 17 ERP
How to do quick user assign in kanban in Odoo 17 ERPCeline George
 
Gas measurement O2,Co2,& ph) 04/2024.pptx
Gas measurement O2,Co2,& ph) 04/2024.pptxGas measurement O2,Co2,& ph) 04/2024.pptx
Gas measurement O2,Co2,& ph) 04/2024.pptxDr.Ibrahim Hassaan
 
call girls in Kamla Market (DELHI) 🔝 >༒9953330565🔝 genuine Escort Service 🔝✔️✔️
call girls in Kamla Market (DELHI) 🔝 >༒9953330565🔝 genuine Escort Service 🔝✔️✔️call girls in Kamla Market (DELHI) 🔝 >༒9953330565🔝 genuine Escort Service 🔝✔️✔️
call girls in Kamla Market (DELHI) 🔝 >༒9953330565🔝 genuine Escort Service 🔝✔️✔️9953056974 Low Rate Call Girls In Saket, Delhi NCR
 
Incoming and Outgoing Shipments in 3 STEPS Using Odoo 17
Incoming and Outgoing Shipments in 3 STEPS Using Odoo 17Incoming and Outgoing Shipments in 3 STEPS Using Odoo 17
Incoming and Outgoing Shipments in 3 STEPS Using Odoo 17Celine George
 
Grade 9 Q4-MELC1-Active and Passive Voice.pptx
Grade 9 Q4-MELC1-Active and Passive Voice.pptxGrade 9 Q4-MELC1-Active and Passive Voice.pptx
Grade 9 Q4-MELC1-Active and Passive Voice.pptxChelloAnnAsuncion2
 
THEORIES OF ORGANIZATION-PUBLIC ADMINISTRATION
THEORIES OF ORGANIZATION-PUBLIC ADMINISTRATIONTHEORIES OF ORGANIZATION-PUBLIC ADMINISTRATION
THEORIES OF ORGANIZATION-PUBLIC ADMINISTRATIONHumphrey A Beña
 
USPS® Forced Meter Migration - How to Know if Your Postage Meter Will Soon be...
USPS® Forced Meter Migration - How to Know if Your Postage Meter Will Soon be...USPS® Forced Meter Migration - How to Know if Your Postage Meter Will Soon be...
USPS® Forced Meter Migration - How to Know if Your Postage Meter Will Soon be...Postal Advocate Inc.
 
Judging the Relevance and worth of ideas part 2.pptx
Judging the Relevance  and worth of ideas part 2.pptxJudging the Relevance  and worth of ideas part 2.pptx
Judging the Relevance and worth of ideas part 2.pptxSherlyMaeNeri
 

Recently uploaded (20)

How to Add Barcode on PDF Report in Odoo 17
How to Add Barcode on PDF Report in Odoo 17How to Add Barcode on PDF Report in Odoo 17
How to Add Barcode on PDF Report in Odoo 17
 
Computed Fields and api Depends in the Odoo 17
Computed Fields and api Depends in the Odoo 17Computed Fields and api Depends in the Odoo 17
Computed Fields and api Depends in the Odoo 17
 
Inclusivity Essentials_ Creating Accessible Websites for Nonprofits .pdf
Inclusivity Essentials_ Creating Accessible Websites for Nonprofits .pdfInclusivity Essentials_ Creating Accessible Websites for Nonprofits .pdf
Inclusivity Essentials_ Creating Accessible Websites for Nonprofits .pdf
 
Earth Day Presentation wow hello nice great
Earth Day Presentation wow hello nice greatEarth Day Presentation wow hello nice great
Earth Day Presentation wow hello nice great
 
AMERICAN LANGUAGE HUB_Level2_Student'sBook_Answerkey.pdf
AMERICAN LANGUAGE HUB_Level2_Student'sBook_Answerkey.pdfAMERICAN LANGUAGE HUB_Level2_Student'sBook_Answerkey.pdf
AMERICAN LANGUAGE HUB_Level2_Student'sBook_Answerkey.pdf
 
Difference Between Search & Browse Methods in Odoo 17
Difference Between Search & Browse Methods in Odoo 17Difference Between Search & Browse Methods in Odoo 17
Difference Between Search & Browse Methods in Odoo 17
 
ANG SEKTOR NG agrikultura.pptx QUARTER 4
ANG SEKTOR NG agrikultura.pptx QUARTER 4ANG SEKTOR NG agrikultura.pptx QUARTER 4
ANG SEKTOR NG agrikultura.pptx QUARTER 4
 
Roles & Responsibilities in Pharmacovigilance
Roles & Responsibilities in PharmacovigilanceRoles & Responsibilities in Pharmacovigilance
Roles & Responsibilities in Pharmacovigilance
 
HỌC TỐT TIẾNG ANH 11 THEO CHƯƠNG TRÌNH GLOBAL SUCCESS ĐÁP ÁN CHI TIẾT - CẢ NĂ...
HỌC TỐT TIẾNG ANH 11 THEO CHƯƠNG TRÌNH GLOBAL SUCCESS ĐÁP ÁN CHI TIẾT - CẢ NĂ...HỌC TỐT TIẾNG ANH 11 THEO CHƯƠNG TRÌNH GLOBAL SUCCESS ĐÁP ÁN CHI TIẾT - CẢ NĂ...
HỌC TỐT TIẾNG ANH 11 THEO CHƯƠNG TRÌNH GLOBAL SUCCESS ĐÁP ÁN CHI TIẾT - CẢ NĂ...
 
Visit to a blind student's school🧑‍🦯🧑‍🦯(community medicine)
Visit to a blind student's school🧑‍🦯🧑‍🦯(community medicine)Visit to a blind student's school🧑‍🦯🧑‍🦯(community medicine)
Visit to a blind student's school🧑‍🦯🧑‍🦯(community medicine)
 
How to do quick user assign in kanban in Odoo 17 ERP
How to do quick user assign in kanban in Odoo 17 ERPHow to do quick user assign in kanban in Odoo 17 ERP
How to do quick user assign in kanban in Odoo 17 ERP
 
Raw materials used in Herbal Cosmetics.pptx
Raw materials used in Herbal Cosmetics.pptxRaw materials used in Herbal Cosmetics.pptx
Raw materials used in Herbal Cosmetics.pptx
 
Gas measurement O2,Co2,& ph) 04/2024.pptx
Gas measurement O2,Co2,& ph) 04/2024.pptxGas measurement O2,Co2,& ph) 04/2024.pptx
Gas measurement O2,Co2,& ph) 04/2024.pptx
 
call girls in Kamla Market (DELHI) 🔝 >༒9953330565🔝 genuine Escort Service 🔝✔️✔️
call girls in Kamla Market (DELHI) 🔝 >༒9953330565🔝 genuine Escort Service 🔝✔️✔️call girls in Kamla Market (DELHI) 🔝 >༒9953330565🔝 genuine Escort Service 🔝✔️✔️
call girls in Kamla Market (DELHI) 🔝 >༒9953330565🔝 genuine Escort Service 🔝✔️✔️
 
Incoming and Outgoing Shipments in 3 STEPS Using Odoo 17
Incoming and Outgoing Shipments in 3 STEPS Using Odoo 17Incoming and Outgoing Shipments in 3 STEPS Using Odoo 17
Incoming and Outgoing Shipments in 3 STEPS Using Odoo 17
 
Grade 9 Q4-MELC1-Active and Passive Voice.pptx
Grade 9 Q4-MELC1-Active and Passive Voice.pptxGrade 9 Q4-MELC1-Active and Passive Voice.pptx
Grade 9 Q4-MELC1-Active and Passive Voice.pptx
 
Model Call Girl in Tilak Nagar Delhi reach out to us at 🔝9953056974🔝
Model Call Girl in Tilak Nagar Delhi reach out to us at 🔝9953056974🔝Model Call Girl in Tilak Nagar Delhi reach out to us at 🔝9953056974🔝
Model Call Girl in Tilak Nagar Delhi reach out to us at 🔝9953056974🔝
 
THEORIES OF ORGANIZATION-PUBLIC ADMINISTRATION
THEORIES OF ORGANIZATION-PUBLIC ADMINISTRATIONTHEORIES OF ORGANIZATION-PUBLIC ADMINISTRATION
THEORIES OF ORGANIZATION-PUBLIC ADMINISTRATION
 
USPS® Forced Meter Migration - How to Know if Your Postage Meter Will Soon be...
USPS® Forced Meter Migration - How to Know if Your Postage Meter Will Soon be...USPS® Forced Meter Migration - How to Know if Your Postage Meter Will Soon be...
USPS® Forced Meter Migration - How to Know if Your Postage Meter Will Soon be...
 
Judging the Relevance and worth of ideas part 2.pptx
Judging the Relevance  and worth of ideas part 2.pptxJudging the Relevance  and worth of ideas part 2.pptx
Judging the Relevance and worth of ideas part 2.pptx
 

Object Modeling Concepts

  • 1. Object Modeling OOAD MCA 405 C (N2) Amandeep S. Patti 1
  • 2. Objects and Classes  Object can be a concept, abstraction or thing with crisp boundaries and meaning for the problem at hand.  They promote understanding of the real world and provide a practical basis for computer implementations. Amandeep S. Patti 2
  • 3. Objects and Classes  A class describes a group of objects with similar properties (attributes), common behaviour (operations), common relations to other objects and common semantics.  The objects in a class share a common semantic purpose. Amandeep S. Patti 3
  • 4. Object Diagram  Object diagram provide a formal graphic notation for modeling objects, classes and their relationships to one another.  Object diagrams are useful both for abstract modeling and for designing actual programs. Amandeep S. Patti 4
  • 5. Object Diagram  There are two types of object diagrams.  A class diagram is a schema, pattern or template for describing many possible instances of data. A class diagram describes object classes.  An instance diagram describes how a particular set of objects relate to each other. An instance diagram describes object instances. Amandeep S. Patti 5
  • 6. Attributes  An attribute is a data value held by the objects in a class.  Each attribute has a value for each object instance.  Different object instances may have same or different values for a given attribute.  Each attribute name is unique within a class.  An attribute should be a pure data value, not an object. Amandeep S. Patti 6
  • 7. Operations and Methods Operations  An operation is a function or transformation that may be applied to or by objects in a class.  Each operation has a target object as an implicit argument. The behaviour of the operation depends on the class of its target.  The same operation may apply to many different classes. Amandeep S. Patti 7
  • 8. Operations and Methods  A method is the implementation of the operation for a class.  An operation may have arguments in addition to its target object. Such arguments parameterize the operation but do not affect the choice of method.  The method depends only on the class of the target object.  When an operation has methods on several classes, it is important that the methods all have the same signature. Amandeep S. Patti 8
  • 9. Notations for Class Diagram  Place the name of the Class Name class in the first Attribute: Type = Value partition (centered, bolded, & capitalized), list the attributes in the second partition, and Operation(arg_List): return type write operations into the third. Amandeep S. Patti 9
  • 10. Links and Associations  Represent static relationship between classes.  A link is a physical or conceptual connection between object instances.  An association describes a group of links with common structure and common semantics. Amandeep S. Patti 10
  • 11. Links and Associations  All the links in an association connect objects from the same classes.  Both often appear as verbs in a problem statement.  Associations are inherently bi-directional.  Associations are often implemented in programming languages as pointers from one object to another. Amandeep S. Patti 11
  • 12. Links and Associations 1 No more than one Company 0..1 Zero or One 1 * Many 0..* Zero or Many 1..* 1..* One or Many Person Amandeep S. Patti 12
  • 13. Multiplicity  It specifies how many instances of one class may relate to a single instance of an associated class.  It constrains the number of related objects.  It is generally described as being “one” or “many”, but it is a subset of non-negative integers.  It depends on assumptions and how you define the boundaries of a problem. Amandeep S. Patti 13
  • 14. Class Name Multiplicity Attribute: Type = Value Operation(arg_List): return type * {Constraints} * For example, one company will have one or more employees, but 1..* 1 each employee works for Class Name one company only. Attribute: Type = Value Operation(arg_List): return type Amandeep S. Patti 14
  • 15. Link Attributes  A link attribute is a property of the links in an association. Accessible by File User Access permission Amandeep S. Patti 15
  • 16. Role Names  A role is an end of an association.  A binary association has two roles, each of which may have a role name.  A role is a name that uniquely identifies one end of an association.  Role names are necessary for associations between two objects of same class. Employee Employe Person Works-for r Company Amandeep S. Patti 16
  • 17. Ordering  The ordering is an inherent part of the association. An ordered set of objects on the “many” end of an association is indicated by writing “{ordered}” next to the multiplicity dot for the role.  This is a special kind of constraint. {Ordered} Window Screen Visible-on Amandeep S. Patti 17
  • 18. Qualification  A qualified association relates two classes and a qualifier.  One to many and many to many associations may be qualified.  The qualifier is a special attribute that reduces the effective multiplicity of an association. Amandeep S. Patti 18
  • 19. Qualification  The qualifier distinguishes among the set of objects at the many end of an association.  A qualified association can also be considered as ternary association. Directory File File name Amandeep S. Patti 19
  • 20. Aggregation  Aggregation is the “part-whole” or “a-part-of” relationship in which objects representing the components of something are associated with an object representing the entire assembly.  The aggregate is semantically an extended object that is treated as a unit in many operations, although physically it is made of several objects. Amandeep S. Patti 20
  • 21. Aggregation  Aggregation is inherently transitive; An aggregate has parts, which may in turn have parts.  Many aggregate operations operate on both direct and indirect parts.  Aggregation can be fixed, variable or recursive. Amandeep S. Patti 21
  • 22. Types of Aggregation  A fixed aggregate has a fixed structure; The types and number of subparts are predefined.  A variable aggregate has a finite number of levels, but the number of parts may vary.  A recursive aggregate contains directly or indirectly, an instance of the same kind of aggregate; the no. of potential levels is unlimited. Amandeep S. Patti 22
  • 23. Propagation of Operations  Propagation is the automatic application of an operation to a network of objects when the operation is applied to some starting object.  The propagation behaviour is bound to an association, direction and operation.  Propagation is indicated on object models with a small arrow & operation name next to the affected association. The arrow indicates the direction of propagation. Amandeep S. Patti 23
  • 24. Generalization  It is the relationship between a class and one or more refined versions of it. The class being refined is called the superclass and each refined version is called subclass.  It is sometimes called the “is-a” relationship because each instance of a subclass is an instance of superclass as well. Amandeep S. Patti 24
  • 25. Generalization  The notation for generalization is a triangle connecting a superclass to its subclasses. The superclass is connected by a line to the apex of the triangle and the subclasses are connected by the line to a horizontal bar attached to the base of the triangle. Amandeep S. Patti 25
  • 26. Generalization Figure Color Center position  “Dimensionality” is Move discriminator. select  It is an attribute of enumeration type that dimensionality indicates which property One Dim Two Dim of an object is being Orientation Orientation abstracted by a Fill type particular generalization Scale Scale relationship. fill Amandeep S. Patti 26
  • 27. Generalization, Inheritance and Specialization  Generalization is used to refer to the relationship among classes, while inheritance refers to the mechanism of sharing attributes and operations using the generalization relationship.  Generalization and specialization are two different viewpoints of the same relationship, viewed from superclass or from the subclass. Amandeep S. Patti 27
  • 28. Aggregation V/s Generalization  Aggregation relates instances. Two distinct objects are involved; One of them is part of other whereas generalization relates classes and is a way of structuring the description of a single object. Both super class and subclass refer to properties of a single object. Amandeep S. Patti 28
  • 29. Aggregation V/s Generalization  An aggregation tree is composed of object instances that are all part of a composite object; A generalization tree is composed of classes that describe an object.  Aggregation is often called “a-part-of” relationship (sometime called “and-relationship”); Generalization is often called “a-kind of” or “is-a” relationship (sometime called “or- relationship”). Amandeep S. Patti 29
  • 30. Aggregation v/s Association  Aggregation is a special form of association, not an independent concept.  Aggregation adds semantic connotations in certain cases. If two objects are tightly bound by a part-whole relationship, it is an aggregation.  If two objects are independent, and they are linked, it is an association. Amandeep S. Patti 30
  • 31. Abstract class  An incomplete superclass that defines common features to several classes.  Not instantiated.  Frequently used to define methods to be inherited by subclasses.  It can define the protocol for an operation (abstract operation) without supplying a corresponding method, for which each subclass must provide its own implementation. Amandeep S. Patti 31
  • 32. Concrete class  Is a complete class.  Describes a concept completely.  Is intended to be instantiated.  It may have abstract subclasses (but they in turn must have concrete descendants).  Only concrete classes may be leaf classes in the inheritance tree. Amandeep S. Patti 32
  • 33. Generalization as Extension and Restriction  In generalization, an instance of a class is an instance of the class. Therefore all ancestor class features must apply to the subclass instances. A descendent class cannot omit or suppress an ancestor attribute because then it could not truly be an ancestor instance. Similarly operations on an ancestor class must apply to all descendent classes. A subclass may re-implement an operation for reasons of efficiency but cannot change the external protocol.  Adding features is called Extension.  Constraining ancestor attributes is called Restriction. Amandeep S. Patti 33
  • 34. Overriding Operations  The mechanism by which a child class can provide an alternative implementation of a method currently provided by a parent class.  Overriding for extension: the new operation is the same as the inherited operation, except it adds some behaviour, usually affecting new attributes of the subclass.  Overriding for restriction: The new operation restricts the protocol, such as tightening the types of arguments. Amandeep S. Patti 34
  • 35. Overriding Operations  Overriding for optimization: An implementation can take advantage of the constraints imposed by a restriction to improve the code for an operation, and it is valid use of overriding.  Overriding for convenience: A common practice in developing new classes is to look for a class similar to what is desired. The new class is made a subclass of the existing class and overrides the methods that are inconvenient. This ad hoc use of inheritance is semantically wrong. Amandeep S. Patti 35
  • 36. Multiple Inheritance  A class may inherits features from more than one superclass. Such class is called a join class.  A feature from the same ancestor class found along more than one path is inherited only once.  The advantage of multiple inheritance is greater power in specifying classes and an increased opportunity for reuse. It brings object modeling closer to the way people thinks.  The disadvantage is a loss of conceptual and implementation simplicity. Amandeep S. Patti 36
  • 37. Workarounds Employee Employee Employee Payroll Pension Hourly Salaried Exempt Vested Unvested Employee Employee Employee Employee Employee Multiple Inheritance Using delegation Amandeep S. Patti 37
  • 38. Workarounds Employee Employee Pension Pay Status Pension Status Hourly Salaried Exempt Vested Unvested Employee Employee Employee Employee Employee Multiple Inheritance using inheritance & delegation Amandeep S. Patti 38
  • 39. Metadata  Data about data.  Models are inherently metadata.  Parts catalogs, blue-prints, dictionaries etc.  Patterns and Metadata Amandeep S. Patti 39
  • 40. Constraints  Constraints are functional relationships between entities of an object model. The term entity includes objects, classes, attributes, links and associations.  A constraint restricts the values that entities can assume.  A good object model captures many constraints through its structure.  Object modeling notation for constraints is as follows: Constraints are delimited by braces and positioned near the constrained entity. A dotted line connects multiple constrained entities. Amandeep S. Patti 40
  • 41. Constraints Employe Window e Length Salary width {Salary <= boss.Salary} {length > width} Constraints on objects {ordered} Country Office Person Constraints on association links Amandeep S. Patti 41
  • 42. Derived Objects, Links and Attributes  A derived object is defined as a function of one or more objects, which in turn may be derived.  The notation for derived entity is a slash or diagonal line (on the corner of a class box, or an association line, or in front of an attribute). Machine Assembly Part offset offset Offset Amandeep S. Patti 42
  • 43. Homomorphism Maps Contains Contains CatalogItem Item Model number Serial number Describes {Item1 contains item2 => item1.model contains item2.model} Homomorphism for a parts catalog Amandeep S. Patti 43

Editor's Notes

  1. Object Oriented Analysis &amp; Design