Understanding Object Modeling in Software Development

Slide Note
Embed
Share

Object modeling is a crucial concept in software development, capturing the static structure of a system by depicting objects, their relationships, attributes, and operations. This modeling method aids in demonstrating systems to stakeholders and promotes a deeper understanding of real-world entities. Objects, classes, and their interactions are essential components in object modeling, helping create a practical basis for computer implementation. Learn more about object modeling, classes, objects, and object diagrams in this informative content.


Uploaded on Aug 17, 2024 | 1 Views


Download Presentation

Please find below an Image/Link to download the presentation.

The content on the website is provided AS IS for your information and personal use only. It may not be sold, licensed, or shared on other websites without obtaining consent from the author. Download presentation by click this link. If you encounter any issues during the download, it is possible that the publisher has removed the file from their server.

E N D

Presentation Transcript


  1. Visit for more Learning Resources Visit for more Learning Resources

  2. 2. Class Modeling An object model captures the static structure of a system by showing the objects in the system ,and relationship between the objects, and the attributes and operations that characterize each class of objects.

  3. Object modeling gives the static structure of objects, classes and their relationship to one another. Object model is useful for demonstration of a system to customers.

  4. Objects The purpose of object modeling is to describe objects. Object promotes understanding of the real world and provide a practical basis for computer implementation. Objects are separate ,distinguishable entities. They are basic entities.

  5. Object means a single thing or group of similar things. Example: 1.A single apple : 1 object 2. Two to three apple : Group of object Another example a 1 person and a group of person

  6. Classes A class is a group of objects with similar properties(attributes),behaviour(operation),co mmon relationship to other objects . A class is a collection of objects of similar types. Once a class has been defined we can create any number of objects belonging to the same class. Example:- table, chair,desk are objects of class furniture.

  7. Fig. Class & Objects Class object object (TYCOMPUTER) Sanjivani (TYCOMPUTER) Bhavana TYCOMPUTER Class is represented by rectangle box whereas objects are represented by rounded box.

  8. Object Diagram Object diagram provides a graphical representation. It gives graphical representation of objects ,classes and their relationship to one another. There are two types of object diagrams. 1.Class diagrams 2.Instance diagrams

  9. A class diagram is a rectangle for describing many possible instances (object) of data. Class diagram describes object classes i.e. objects. An instance diagram describes object instances.

  10. Attributes(data) An attribute is nothing but data values of an object. Ex:- Name ,age and address are attributes of TYCOMPUTER objects. Each object has value for each object instance. Ex:- attribute AGE of TYCOMPUTER class has value 16 .

  11. Fig. Attributes and values Class with attributes Objects with values TYCOMPUTER (TYCOMPUTER) Sanjivani 18 (TYCOMPUTER) Bhavana 20 Name:string Age:Integer

  12. Class TYCOMPUTER has a attributes name and age. Name is string and age is an integer. One object in class TYCOMPUTER has the value Sanjivani for name and 18 for age.

  13. Operations and Methods An operation is nothing but function which is used by objects in a class. The same operation may be applied to many different classes. Such an operation is polymorphic. Ex:- The class NUMBER may have operation ADD.Different methods could be implemented to add integer numbers, add float numbers. All these methods perform the same task:addition of numbers.

  14. Fig.Operations The class TYCOMPUTER has name & age as attributes and operations change class & change address. TYCOMPUTER Name Age Change class Change Address

  15. Object modeling Notation for Class A class is represented in a BOX which has 3 parts. 1st part: Class name 2nd part: Attributes 3rd part: Operations

  16. Links And Associations Links and associations are the ways of connections among objects and classes. A link is physical connection between objects. A link is an instance of an association. A link shows relationship between two or more objects.

  17. Associations An association is a group of links with common structure. All the links in an association connect object from the same classes. Associations are bi-directional. Associations are of many types like one-to- one,multiplicity,binary,ternary or higher order. The OMT notation for an association is a line between classes. Association names are written on that line in italic font.

  18. Fig.One to One association & Links Class Diagram Each Country class has capital city class. So Has_Capital is the name of the association Has Capital Country City Name Name Class Diagram

  19. Fig.One to One association & Links Instance Diagram(Object Diagram) Has_capital (City) Delhi (Country) India (Country) USA Has_capital (city) Washington

  20. Association Relationships If two classes in a model need to communicate with each other, there must be link between them. An association denotes that link. Student Instructor Software Design (UML)

  21. Association Relationships (Contd) We can indicate the multiplicity of an association by adding multiplicity adornments to the line denoting the association. The example indicates that a Student has one or more Instructors: Student Instructor 1..* Software Design (UML)

  22. Association Relationships (Contd) The example indicates that every Instructor has one or more Students: Student Instructor 1..* Software Design (UML)

  23. Multiplicity Association Multiplicity is described as being one or many. Multiplicity shows how many instances of one class may relate to a single instance of an associated class. Multiplicity shows the number of related objects.

  24. Class Diagram LINE Intersects Point Name Name

  25. Many to Many association & Links Line(L1) Line P1 Line(L2) Line(L3) Line P2 Line(L4) Line(L5)

  26. Ternary Association The OMT symbol for ternary association is a diamond with lines connecting to related classes. The name association is written next to the diamond. A person who are programmers use computer languages on projects.

  27. Ternary Association and Links LANGUAGE PROJECT PERSON

  28. Multiplicity An association represents a structural relationship among objects. It s important for you to state how many objects may be connected across an instance of an association. This how many is called the multiplicity of an association s role, and is return as an expression that evaluates to a range of values or an explicit value

  29. Optional Multiplicity It is also called as zero or one ,or optional multiplicity.

  30. Advanced Link & Association Link Attribute: A link attribute is a property of the links in an association. It is a property of the objects in a class similar to the attribute. The OMT notation for a link attribute is a box attached to the association by a loop symbol.

  31. Fig.Link Attribute Accessible By FILE User ACCESS PERMISSION Access permission is an attribute of accessible by link.

  32. Link Attribute for One to Many Association Each person working for a company receives a salary and has a job title. The BOSS calculates the performance of each worker.

  33. Link Attribute For Ternary Association A cricketer may play for many teams in a given year. A cricketer may also play many years for the same team. Each team has many cricketers. For each combination of team and year ,a cricketer has record of runs and wickets.

  34. ROLE NAMES A role is one end of association. A role name is a name written at one end of association. EX:A person assumes the role of employee w.r.to a company and a company assumes the role of employer w.r.to a person. A role name is written next to the association line near the class that plays the role.

  35. We can also indicate the behavior of an object in an association (i.e., the role of an object) using rolenames. teaches learns from Student Instructor 1..* 1..* Software Design (UML)

  36. Ordering It is a special kind of facility available in OMD. It can be considered as a set. Such kind of externally ordered objects are denoted by writing {ordered} on the many end of an association. i.e. next to the multiplicity dot for the role.

  37. Ordered Sets in an association SCREEN WINDOW Visible on

  38. Qualification The Qualifier is a special attribute that reduces the effective multiplicity of an association.

  39. Aggregation An aggregation is a special form of association that models a whole-part relationship between an aggregate (the whole) and its parts. The OMT Notation for aggregation is:

  40. Aggregation is the (*the*) relationship between two classes. When object of one class has an (*has*) object of another, if second is a part of first (containment relationship) then we called that there is an aggregation between two classes.

  41. Examples: A Library contains Books Within a company Departments are made-up of Employees. A Computer is composed of a number of Devices.

  42. Example: an Customer has an Address. We use aggregation because the two classes represent part of a larger whole. We have also chosen to model Address as a separate class, since many other kinds of things have addresses as well. An aggregate object can hold other objects together

Related


More Related Content