1 / 151

Object-Oriented Modeling and Design

Object-Oriented Modeling and Design. Object-Oriented models are useful for :. understanding problems communicating with application experts modeling enterprises preparing documentation. What is Procedure-Oriented Programming ?. Emphasis is on doing things (algorithms)

Download Presentation

Object-Oriented Modeling and Design

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Object-Oriented Modeling and Design

  2. Object-Oriented models are useful for : • understanding problems • communicating with application experts • modeling enterprises • preparing documentation

  3. What is Procedure-Oriented Programming ? • Emphasis is on doing things (algorithms) • Large programs are divided into smaller programs (functions) • Most of the functions share global data • Data move openly around the system from fn.. to fn • Functions transforms data from one form to another • Employs top-down approach in program design

  4. Relationship of data and functionsin Procedural Programming

  5. What is Object-Oriented Programming ? • Emphasis is on data rather than procedure • Programs are divided into Objects (Abstracted into classes) • Data is encapsulated in the objects • Objects communicate with each other through functions • Follows bottom-up approach in program design.

  6. What is Object-Oriented Programming ?

  7. Characteristics of Object-Oriented Model • Abstraction • Encapsulation • Polymorphism • Inheritance

  8. Abstraction • Focus is an what an Object is and does before deciding how it should be implemented. • Use of abstraction preserves the freedom to make decisions as long as possible by avoiding premature commitments to details.

  9. Encapsulation • Separates the external aspects of an object, which are accessible to other objects, from the internalimplementation details of the object. • Prevents a program from becoming so inter-dependent that a small change has massive ripple effects.

  10. Polymorphism • The same operation may behave differently on different classes. • An operation is an action or transformation that an object performs or is subject to. • Example : 'move' operation may behave differently on the Window and Chess Piece Classes.

  11. Inheritance • Is the sharing of attributes and operations among classes based on a hierarchical relationship. • The properties of a Superclass need not be repeated in the subclass. • Example : Scrolling Window and Fixed Window are subclasses of Superclass Window.

  12. OBJECT MODELING CONCEPTS

  13. An Object Model • captures the static structure of the systemshows the objects, the relationship between them,and • the attributes and operations that characterize each class of objects.

  14. Objects is a concept, abstraction, or thing with crisp boundaries and meaning for an application. Purpose promotes understanding of the real world provides a practical basis for computer information. Objects have identity and are distinguishable. Example : Two apples with the same color, shape and texture are still individual entities.

  15. Classes It describes a group of objects, with common attributes, operations and semantics. Example : Fruit is a class. Objects in a class have the same attributes and behaviour patterns. A object's class is an implicit property of the object.

  16. OBJECT DIAGRAMS • Object Diagrams provides a formal graphic notation for modeling objects, classes and their relationships to one another. • They are concise and easy to understand.

  17. OBJECT DIAGRAMS OMT symbol for a class in a box. Person CLASS

  18. ATTRIBUTES • is a property of the objects in a class • is a data value held by the objects in a class • different Object instances may have the same or different values for a given attribute.

  19. ATTRIBUTES • Each attribute name is unique within a class. • An attribute should be a pure data value, not an object.

  20. OPERATIONS • An operation is a function or transformation that may be applied to or by objects in a class. • Same operations may apply to many different classes (Polymorphic Operation).

  21. Methods is the implementation of an operation for a class. Example : Operation 'Print' in class 'File' can be implemented for printing ASCII files, printing binary files are for printing digitized picture files.

  22. Links and Associations A link is a physical or conceptual connection object instances i.e. represents the relationship between them. Example : Joe Smith works for Simplex Company

  23. Links and Associations • An association describes a group of links with common structure and common semantics. • Example : A persons works for a company. • Association and links often appear as verbs in the problem statement.

  24. Representation of Links / Associations Associations may be binary, ternary or higher order.

  25. Representation of Links / Associations used to represent ternary and n-ary association.

  26. Multiplicity of an Associations • Specifies how many instances of one class may to a single instance of an associated class. • Usually described as "one" or "many".

  27. Multiplicity of an Associations In OMT notation, * Solid Ball => "many" meaning zero or more * Hollow ball => "optional" meaning zero or one * A line without balls => one-to- one association.

  28. Multiplicity of an Associations

  29. Link and Association Concepts Link Attribute is a property of the links in an association. In OMT notation, it is represented by a box attached to the association by a loop.

  30. Link and Association Concepts Role Names * Role is one end of an association. * Role name is a name that uniquely identifies one end of an association.

  31. Qualified Association Qualifier is a special attribute that reduces the effective multiplicity of an association. This reduces the effective multiplicity of this association from one-to-many to one-to-one.

  32. Generalization • * Is the relationship between a class and one or more refined versions of it. • The class being refined is called the Super Class. • Each refined version is called the Sub Class. • Is also called the "is-a" relationship. In OMT notation, generalization is represented by a triangle connection a superclass to its subclass.

  33. Generalization

  34. Inheritance • Each subclass is said to inherit the features of its superclass.

  35. Inheritance • Each subclass not only inherits all the features of its ancestors but adds its own specific attributes and operations as well.

  36. Inheritance A subclass may override a Superclass features by defining a feature with the same name.

  37. Multiple Inheritance • A class may have more than one superclass and inherits features from all panels • Such a class is called a "Join Class".

  38. Multiple Inheritance Example:

  39. Generalization as Extension and Restriction Extension : When a subclass adds new features.

  40. Generalization as Extension and Restriction Restriction : When a Subclass constrains the ancestor attributes. Example:

  41. Generalization, Inheritance and Specialization Generalization and Inheritance: • Generalization is the relationship among classes. • Inheritance is the mechanism of sharing attributes and operations using the generalization relationship.

  42. Generalization, Inheritance and Specialization Generalization and Specialization: • (Basically they are two different viewpoints of the same relationship) • Generalization => Superclass generalizes the subclass. • Specialization => Subclass refines or Specializes the Superclass.

  43. Aggregation: • Is the "part-whole" or "a-part-of" relationship • Objects representing the components are associated with an object representing the entire assembly. • Aggregation is a special form of association.

  44. Aggregation: In OMT notation, aggregation is represented by a small diamond at the assembly end of the relationship. Example:

  45. Aggregation Versus Generalization • Aggregation relates instances • two distinct parts are involved, one is a part of • the other. • Generalization relates classes • Subclass inherits the properties of the • Superclass.

  46. Aggregation Versus Generalization Aggregation and Generalization

  47. ABSTRACT CLASSES • An abstract class is a class that has no direct • instances but whose descendent classes have direct • instances.

  48. CONCRETE CLASSES A Concrete class is a class that is instantiable. Example:

  49. META DATA • Is data that describes other data • Many real-world applications have metadata such as pats catalogs, blueprints and dictionaries.Example : The definition of a class is metadata.

  50. META DATA • In RDBMS, a data table may store information such as capital of India is New Delhi. • Capital of Japan is Tokyo. And so on .…A meta table will store the fact that a • country has a Capital City.

More Related