You are on page 1of 17

OBJECT We define an object as a concept, abs ration or thin g with crisp boundaries and meaning for the problem

at hand. Object serve two purpose: They promote understanding of the real world and provide a practical basis for computer implementation. Decomposition of a problem into objects depend on judgment and the nature of the problem. All objects have identity and are distinguishable. Twins are two identical persons, even though they may look the same. The term identity means that objects are distinguished by their inherent existent and not by descriptive properties that they may have. The word object is often vaguely used in the literature. Sometime object means a single times it refers to a group of Similar things. Usually the context resolves any ambiguity.

CLASSES An objects class describes a group of objects with similar properties , common behavior, common relationship to other objects and common semantics. The abbrevation class is often used instead of objects classes. Objects in a class have the Same attributes and behavior patterns. Most objects derive their individuality from difference in there attribute values and relationship to another. The objects in a class shares a common semantic purpose, above and beyond there equipment of common attributes and behavior. Each object "knows" its class. Most object oriented programming languages can determine an objects class at run time. If objects are the focus of object modeling why both wit h classes? The notation of abstraction at the heart of t e matter. By grouping into objects into classes, we abstract a problem . Abstraction gives modeling its power and ability to generalize from a few specific case to a host of similar cases. Operations can be written once per instances. Operation s can be written on e for each class, so that all the objects in the class benefits from code reuse. Even special cases, such as circles and squares, can use the general procedure, though more efficient procedures are possible.

1.Link Attributes
An attribute IS a property of the objects in a class. Similarly, a link attribute is a property of the Iinks in an association Access permits $1 on Is an attribute of Accessible by. Each Iink

Object connected languages provide strong support for the notion of inheritance In contrast. The term ancestor and descendent refer to generalization of classes across the multiple Ievels. Generalization and inheritance are transitive across an arbitrary number of levels. The subclasses are connected by Iines to a horizontal bar attached to the base of the triangle . The notation for generalization Is a triangle connecting a super class to its subclasses . Many -to -many associations pro vi de the most compelling rati Dante for link attributes. The super class is connected by a line to the apex of the triangle. as illustrated by the sample data at the bottom of the figure The OMT notation for a link attribute is a box attached to the association by a loop one or more link attributes may appear In the Second region of the box. Such an attribute is a property of the link and cannot be attached to either object. Current database systems provide Iittle or no support for inheritance . Generalization is sometime called " is a" :relationship because each Instance of subclass is an instance of superclass as well. This notation emphasizes the similarity between attributes for links. Access permission is a property of Yd e and User. Generalization is the relation between a class an done or more refined version s of it. An instance of a subclass is simultaneously an instance of its ancestor classes. Each subclass is said to inherit the features of its superclass. Use of generalization Generalization is a useful constructor both modeling and implementation Generalization facilitates modeling by structuring classes and capturing what is similar and what is different about classes. The class being refined is called the super class and each refined version is called a subclass attributes and operation common to a group of sub classes are attached to the super class an d shared by e ach subclass. and cannot b e attached to either File or User alone without I o sing Information Generalization and inheritance Generalization and inheritance are abstractions for sharing similarities among classes while preserving their differences . Object connected database programming languages and extended relational database systems show promise of connecting this . Inheritance of operations is help full during implementation as a vehicle for reusing code.attribute has a value for each . Each subclass not only Inherits all the features of its ancestors but adds its on specific attributes and operations as well.

Other abstract classes are artificially introduced as a mechanism for promoting code rense. After modeling a system the developed at the resulting classes and these to group simliar classes and reuse common code. Abstract classes An abstract class is a class that has no Instances but whose descendent classes have direct instances. one is part of the other. The individual parts may or may not exist independently. It adds semantic connotation in some cases. If not they shod be mode/led as normal relationships. If objects are tightly bound in a part hole relationship it might be usefuI to model the relationships as an aggregation. The choice between using aggregation or not is one of judgement more then one of rules. The trigger leads to the application of a network of operations. A recursive aggregate has directly or indirectly an instance of the same kind of aggregate. It is open useful to create an abstract Super class to encapsulate classes that participate In the association or aggregation . A concrete class is a class that Is instantiable that is can Ieave direct instances. A concrete class may have abstrct classes. An object is simultaneously part of the both the subclass and the super-class. Propagation or triggering is a good indicator of aggregation. In a variable aggregate the number of parts may vary. . Zorne abstract classes appear naturally In the application domain . Generalization models the relationship subclass super-class. The figure shows the definition o f abstract class an d concrete class . Both sub-class and superclass refer to the same object. In aggrega6on individual distinct objects is combined. Aggregation Aggregation is a strong form of association. variable or recursive. An aggregaton is a complex object. which is made up of component objects. Aggregation is seen as an part hole relationship and generalization is called "a kind of" or "is a". An aggregate can be fixed. Semantically it is an extended object that is treated as a unit. A fixed aggregate means that the number of subparts is predefined. When moving an aggregate of its parts moves. the dotted line IS the objct modeling notation for Instantiation. Aggregation is not the same thing as generalization. Abstract classes organize features to several classes. A concrete class may be a Ieaf class in the Inheritance tree only concrete classes may be the Ieaf class In the inheritance tree.situations.

Changing an operation is called overriding.GE NE RA LIZATION AS EXTENSION AND RESTRICTION An instance of a class is an instance of all ancestors of that class. Class membership is either ruled by rules or explicit by enumeration. If the condition determining class membership is explicit by enumeration an attribute value determines class membership. add new features. except adds some behavior. place constraints on ancestor attributes and rename inherited features. This is called restriction because it restrict the values that instances can assume. Generalization implies that subclasses must bee an instantiation of all its ancestors. usually affecting new attributes of the subclass. The inherited major and minor axes of a circle must be equal and could be renamed the diameter. This is called extension. Inherited features can be renamed in a restriction. A subclass may also constrain ancestor attributes. Overriding is done for: * extention in which case some extra behavior is added * restriction when the types of possible arguments is limited Overriding for extension: The new operation is same as the inherited operation. However a subclass may implement operations. In ruled govern memberships defined the conditions for being a class member it is a ruled based membership. . A subclass may add new features. A subclass can not omit any inherited features and all ancestor operations must apply.

Object design includes • reuse. and optimizing the object model for performance. selecting off-the-shelf components. Models are inherently metadata. This includes precisely describing object and subsystem interfaces. Patterns and Metadata Real world things may be metadata. Iike a blueprint describes a house. restructuring the object model to attain design goals such' as extensibility or understandability. The interface specification activities of object design include . during which we identify off-the-shelf components and design patterns to make use of existing solutions • service specification. during which we precisely describe each class interface • object model restructuring. developers define solution domain objects to bridge the gap between the analysis model and the hardware/software platform defined during system design. This may necessary to keep the inherited operation closed with in the subclass. There are real world things that describe other realworld things. Object design is not sequential. METADATA Meta data is data that describes other data. during which we transform the object design model to improve its understandability and extensibility • object model optimization. during which we transform the object design model to address performance criteria such as response time or memory utilization. since they describe the things being modelled. Object design like system design is not algorithmic.Overriding for restriction: The new operation restricts the protocol such astightening the type of arguments. Object Design During object design. The result of the object design activity is a detailed object model annotated with constraints and precise descriptions for each clement.

• identifying missing attributes and operations • specifying type signatures and visibility • specifying invariants • specifying preconditions and postconditions. Dynamic modeling Events and states An object model describes the possible patterns of objects. states and state transitions for a given class can be abstracted and represented as a state diagram. The attribute values and links held by an object are called its state. Over time. which may or may not choose to send it. Two events that are causally unrelated are said to be concurrent. One event may logically precede or follow another. An object sending an event to another object may expect a reply. The pattern of events. The dynamic model consists of multiple state diagrams. attributes and links that can exist in a system. but the reply is a separate event under control of the second object. or the two events may be unrelated. An event is one way transmission of information from one object to another. An event has no duration. they have no effect on each other. one state diagram for each class with important dynamic behavior. Events An event is a something that happens at a point of time. resulting in a series of changes to their states. Example of event classes and attributes . Some classes of events may be simply signals that something has occurred. An individual stimulus from one objet to another is called an event. the objects stimulate each other. while other classes of events convey data values. The data values of an event are its attributes. An event conveys information from one object to another.

flight num. it may include all events in a system. The scope of scenario can vary.airplane flight departs (airline. or it may include only those events impinging on or generated by certain objects in a system. location) input string entered(text) phone receiver lifted dialed(digit) speed enters danger zone digit engine Scenarios and event traces A scenario is a sequence of events that occurs during one particular execution of a system. city) mouse button pushed (button. A scenario for a phone call Caller lifts receiver tone begins dials digit (5) tone ends Caller dials digit (5) Caller dials digit (5) Caller dials digit (1) Caller dials digit (2) Caller dials digit (3) Caller dials digit (4) Called phone begins ringing Ringing tone appears in calling phone Called party answers Called phone stops ringing Ringing tone disappears in calling phone Phones are connected Called party hangs up Dial Caller Dial .

Phones are disconnected Caller hangs up Each event transmits information from one object to another. The sequence of events and the objects exchanging events can both be in an augmented scenario called an event trace diagram Event trace for a phone call Caller lifts receiver Dial tone begins Caller dials digit (5) Dial tone ends Caller dials digit (5) Caller dials digit (5) Caller dials digit (1) Caller dials digit (2) Caller dials digit (3) Caller dials digit (4) Ringing tone phone rings Answers phone Tone stops Phones connected ringing stops Phones connected . The next after writing a scenario is to identify the sender and receiver objects of each event.

When an event is received the next state depends on the current state as well as event. a change of state caused by an event is called a transition. and we lump together in a single state all combinations of attribute values and links that have the same responses to events. A state specifies the response of the object to input events. a transition is drawn as an arrow from the receiving state to the target state. but the responses are quantitatively the same for all values within the same state.Callee hangs up Connection broken Caller hangs up Connection broken Caller phone line callee States A state is an abstraction of the attributes values and links of an object. The state diagram specifies the state sequence . A state diagram is a graph whose nodes are states and whose directed arcs are transitions labeled by an event names. and may be quantitatively different for values in different states. The response to an event received by an object may vary quantitatively depending on the exact values of its attributes. Sets of values are grouped together into a state according to properties that affect the gross behavior of the object. State diagrams A state diagram relates events and states. A state has duration it occupies an interval of time. A state is drawn in rounded box containing an optional name. All the transitions leaving a state must correspond to different events. A state is associated with a continuous activity. the label on the arrow is the name of the events causing the transition. In defining state we ignore those attributes that do not affect the behavior of the object.

. It also represent one shot life cycles or continuous loops.caused by an event sequence.


Summary of notation for unstructured state diagrams . following the name of the event causes it. A real-world operation is not really instantaneous. Fig. such as getting attributes or generating other events.OPERATIONS Controlling Operations An activity is a operation that take time to complete. An action is associated with an event. An action is an instantaneous operation. The notation "do: A" within a state box indicates that activity A starts on entry to the state and stop on exit. An action represent an operation whose duration is insignificant compared to the resolution of the state diagram. Activities include continuous operations as sequential operations that terminate by themselves after an interval of time. Actions can also represent internal control operations. An activity is associated with a state. The same notation "do: A" indicates that sequential activity A begins on entry to the state and stop when complete. Action for pop-up menu Fig.The notations for an action on a transition is a slash ('/') and the name of the action .

state diagram for phone line .

with limited interaction among them . then expanding at lower level by adding details. the number of transitions could be reduced as low as n. These problems are true of flat. Generalization is equivalent to expanding nested activities. Problems with Flat State Diagrams: State diagrams have often been criticized because they allegedly lack expensive power and impractical for large problems. Representing such an object with a single flat diagram require 2^n states. Consider an object with n in dependent Boolean attributes that affect control. similar to inheritance of attributes and operations in classes. Aggregation allows a state to be broken in to orthogonal components. however. unstructured state diagrams. .NESTED STATE DIAGRAMS State diagrams can be structured to permit concise descriptions of complex systems. It allows an activity to be described at a high level. In addition. Consider the state diagram shown in figure in which n^2 transitions are ne e de d to connect ever y state to every other state. similar to a nested procedure call. generalization allows state and events to be arranged in to generalization beer archies with inheritance of common structure and behavior. If this model can be reformulated using structure. partitioning the state in to n independent state machines. The ways of structuring state machines are similar to the ways of structuring objects: generalization and aggregation. Aggregation is equivalent to co n currency of states. only 2n states are required.