Presentation is loading. Please wait.

Presentation is loading. Please wait.

1 Systems Analysis & Design Object Modeling IS 431: Lecture 6 CSUN Information Systems

Similar presentations


Presentation on theme: "1 Systems Analysis & Design Object Modeling IS 431: Lecture 6 CSUN Information Systems"— Presentation transcript:

1 1 Systems Analysis & Design Object Modeling IS 431: Lecture 6 CSUN Information Systems http://www.csun.edu/~dn58412/IS431/IS431_SP15.htm

2 IS 431 : Lecture 6 2 Object Modeling Why Object Modeling ? Object Concepts –Class/Object, Attribute, Behavior, Inheritance, Encapsulation, Message, Polymorphism UML Diagrams for Object-Oriented Analysis –Use Case Diagram –Class/Object Diagrams –Sequence Diagram –Statechart Diagram

3 IS 431 : Lecture 6 3 Object Modeling Object-oriented analysis (OOA) techniques are used to (1) study existing objects to see if they can be reused or adapted for new uses, and (2) define new or modified objects that will be combined with existing objects into a useful business computing application. Object modeling is a technique for identifying objects within the systems environment and the relationships between those objects. The Unified Modeling Language (UML) is a set of modeling conventions (notations) to specify or describe a software system in terms of objects.

4 IS 431 : Lecture 6 4 Object Modeling Benefits: –Break a complex system into manageable components –Create reusable components can be plugged into other systems or use them as starting points for other projects –“Object-think” is more realistic !!!

5 IS 431 : Lecture 6 5 Object Concepts An object is something that is or is capable of being seen, touched, or otherwise sensed, and about which users store data and associate behavior. A class is a set of objects that share common attributes and behavior. A class is also referred to as an object class. Attributes are the data that represent characteristics of interest about an object. An instance (or object instance) of an object consists of the values for the attributes that describe a specific person, place, thing, or event.

6 IS 431 : Lecture 6 6 Classes, Objects, Attributes, & Instances Customer custNo lastName firstName phone street city state changeAddress() Doe:Customer custNo:123 lastName:Doe firstName:Joe phone:1234567 street:AnyStreet city:AnyCity state:AnyState changeAddress() Green:Customer custNo:234 lastName:Green firstName:Mary phone:3456789 street:OtherStreet city:OtherCity state:OtherState changeAddress()

7 IS 431 : Lecture 6 7 Object Concepts … Behavior (method, service) refers to those activities that the object can do and which correspond to functions that act on the object’s data (or attributes). Encapsulation is the packaging of data and method together. It shields the internal working of the object from the changes in the outside system. It keeps the system from being affected when changes are made to objects. It is the key to reusability. –All an object needs to know is the set of methods that other objects can perform and what message need to be sent to trigger them.

8 IS 431 : Lecture 6 8 Common Methods Constructor to create a new instance of a class Query to access and get info about the state of an object but does not alter the state Update to alter the state of an object and change the value of its attribute(s).

9 IS 431 : Lecture 6 9 Supertypes & Subtypes A class supertype is an object class whose instances store attributes that are common to one or more class subtypes of the object. A class subtype is an object class whose instances inherit some common attributes from a class supertype, and then add other attributes that are unique to an instance of the subtype. Inheritance means that methods and/or attributes defined in an object class (superclass) can be inherited or reused by another object classes (subclasses).

10 IS 431 : Lecture 6 10 Generalization Specialization Employee Name DOB SSN DateHire CalSeniority() Executive Position Location DateAppoint Salary Update() Foreperson Factory Station DateAppoint Wage Rate Update() Worker Factory Station Machine Wage Rate Insert ()

11 IS 431 : Lecture 6 11 Object Concepts … Message is the information passed when one object invokes one or more of another object's methods (behaviors) to request information or some action (It is function calling in programming) Customer Order OrderNo OrderDate OrderStatus add() change() displayStatus() displayStatus(123)

12 IS 431 : Lecture 6 12 Object Concepts … Polymorphism means “many forms.” In object- oriented techniques, it means that the same message can be interpreted (and a behavior may be completed) differently by different objects/classes. Methods of the same name in different classes. Methods of the same name (but different parameters) in the same class Insert(customer) is different from insert(inventory-item) as different info need to be collected and stored.

13 IS 431 : Lecture 6 13 Object-Oriented Analysis with UML Diagrams  Modeling the functions of the system (with a use case diagram).  Modeling the objects within the scope of the system and their relationships (with class and object diagrams for each use case, and then for the integrated system).  Modeling the interactions between objects to complete a function/use case (with a sequence diagram for each use case).  Modeling the behavior / logic of the objects (with a statechart diagram for each complex class).

14 IS 431 : Lecture 6 14 UML Diagrams Enter New Customer Create New Order :customer:order Create Order CREATE SIPMENTCREATE ORDER ORDER CUSTOMER SHIPMENT USE CASE DIAGRAMCLASS DIAGRAM FOR USE CASE “Create New Order” SEQUENCE DIAGRAM FOR USE CASE “ Create New Order ” STATECHART DIAGRAM FOR OBJECT “Order” Order Clerk :shipment Create Shipment

15 IS 431 : Lecture 6 15 Use Case Modeling Use case modeling is the process of modeling a system ’ s functions in terms of business events, who initiated the events, and how the system responds to the events. A use case is a complete sequence of related actions (a scenario), both automated and manual, for the purpose of completing a business function: What the system must do. An actor represents an external entity that needs to interact with the system to exchange information. An actor is a user, a role, which could be an external system as well as a person. A temporal event is a system event that is triggered by time. (The actor of a temporal event use case is time.)

16 IS 431 : Lecture 6 16 USE CASE DIAGRAM Use Case Diagram is a functional description (use cases, actors) of the entire system: functions being supported by the system Use Case Diagram is similar to Context Diagram + Level-O DFD in traditional structured technique:  An individual Use Case appears more like a DFD fragment as it identifies an individual function (major process)  In Use Case Diagram, an actor is the one who actually interacts with the system, whether that actor is the original source of information or not (in DFD, an external agent is always the source or destination of info and may not necessarily be the one interacting with the system.)  Use Case Diagram does NOT indicate data flows or flows of information in and out the system (they are identified later in interaction diagrams)

17 IS 431 : Lecture 6 17 A Use Case Diagram

18 IS 431 : Lecture 6 18 Extension and Abstract Use Cases An extension use case extends the functionality of an original use case to add new behaviors or actions to the basic course. An extension use case can only be invoked by the use case it is extending. An abstract use case contains typical course steps that were common to two or more original use cases. An abstract use case reduces redundancy and promotes reuse.

19 IS 431 : Lecture 6 19 Extension Use Cases (“extend” relationship) > Class registration Registration for special classes Insufficient prerequisites “Class registration” is the basic course of actions. On special occasions, “Registration for special classes” and/or “Insufficient prerequisites” will be invoked. Special cases add new data/behaviors to the normal case.

20 IS 431 : Lecture 6 20 Abstract Use Cases (“use” or “include” relationship) > Track sales & inventory Reorder supplies Generate reports “Reorder Supplies” uses “Track sales & inventory” “Generate reports” uses “Track sales & inventory. In programming, it is a common subroutine.

21 IS 431 : Lecture 6 21 Building a Use Case Diagram Identify use cases (major system functions) Identify the system boundary Identify associations between use cases (“extends”, “includes”) for special cases or common subroutines Identify actors (look at the sources and destinations of major inputs and outputs)

22 IS 431 : Lecture 6 22 CLASS / OBJECT DIAGRAMS Class: a set of objects sharing a common structure and a common behavior (Student). Class Diagram: showing the static structure of OO model: classes, their internal structure, and the relationships. Object Diagram: showing the graphs of object instances (class members) of a given class diagram: Marie:student (identified object) or :student (unidentified object).

23 IS 431 : Lecture 6 23 A Class Diagram

24 IS 431 : Lecture 6 24 Object/Class Relationships An object/class relationship is an association that exists between one or more objects/classes. It is defined by business rules and/or common practices. Multiplicity defines how many instances of one object/class can be associated with one instance of another object/class. (It is Cardinality in ERD !!!) 0..* CustomerOrder places

25 IS 431 : Lecture 6 25 UML Multiplicity Notations

26 IS 431 : Lecture 6 26 Aggregation Relationship Operation Team DoctorNurseAdmin staff “is a part of”, “is made of” relationships

27 IS 431 : Lecture 6 27 Generalization Relationship Employee DoctorNurseAdmin staff -“is a kind of” relationships - Showing inheritance (type/subtypes)

28 IS 431 : Lecture 6 28 Building a Class Diagram Identify related classes. A class diagram show the classes that are needed for one particular use case, (not for the whole system as in integrated class diagram). Identify attributes and operations. List only peculiar, special methods (calculateTax) of the class, not the implicit methods (insert). Identify relationships and multiplicity between classes. Make use of generalization and aggregation relationships if possible.

29 IS 431 : Lecture 6 29 SEQUENCE DIAGRAM A Sequence Diagram depicts the interactions among objects of a use case during a certain period of time. It gives an external view of object behaviors. A sequence diagram represents a specific set of messages (function calls) and interchanges between objects. Thus, objects are indicated on the diagram instead of classes. Each actor and object has a lifeline (from top to bottom) that shows the sequence of message. The activation lifeline shows time period during which the object perform an operation. The “X” mark at the end of the activation line indicate the point at which the object ceases to exist in the system.

30 IS 431 : Lecture 6 30 SEQUENCE DIAGRAM … A message symbol in a sequence diagram has 2 parts: A directional arrow A message descriptor in the form of: [true/false condition] return-value:= message-name (arguments) Sometimes, one can use a return arrow if the return value is not very important

31 IS 431 : Lecture 6 31 A Sequence Diagram Template for a Use Case Actor :object 1:object 2 message 1 message 2 message 3

32 IS 431 : Lecture 6 32 :product :order:orderedProduct:order- Clerk :member display member information validate item create item enter item (product number) select new order update address (address) verify member (member number) A Sequence Diagram

33 IS 431 : Lecture 6 33 Building a Sequence Diagram Identify objects and the sequence that these objects interact with each other in each use case. Identify message (function call) and the sequence Draw lifeline and activation boxes (how long we want to keep the class/program active in the system)

34 IS 431 : Lecture 6 34 STATECHART DIAGRAM A Statechart Diagram describes the internal working of an object when it receives a message. Each class in the class diagram for a system has its own unique state diagram. An object comes into existence within the system in some manner. During its existence, it is in certain states, and makes transitions from states to states. An object remains in a state until some event causes it to move to another state.

35 IS 431 : Lecture 6 35 STATECHART DIAGRAM A state for an object is a situation during its life when it satisfies some condition, performs some activity, or waits for some event. (A set of values that describe an object at a specific point in time) An event is something that takes place at a certain point in time and changes value(s) of an object, (which in turn changes the object’s state). Transition is the mechanism that causes an object to leave a state and change to a new state.

36 IS 431 : Lecture 6 36 A Statechart Diagram Template for an Object State 1 Internal Trans State 2 Internal Trans State 3 Internal Trans Init state Final state Event 1 Trans 1 Trans 3 Trans 2 Event 2

37 IS 431 : Lecture 6 37 A Statechart Diagram

38 IS 431 : Lecture 6 38 Building a Statechart Diagram Examine the class diagram and identify which classes must undergo a complex series of state changes and build a statechart diagram for each of them (classes). Identify the various states that an object will have over its life time Determine what causes each state to occur (change)


Download ppt "1 Systems Analysis & Design Object Modeling IS 431: Lecture 6 CSUN Information Systems"

Similar presentations


Ads by Google