+ All Categories
Home > Documents > NSC Network · Web viewObject Oriented Analysis and Design using UML - H. Srimathi, H. Sriram, A....

NSC Network · Web viewObject Oriented Analysis and Design using UML - H. Srimathi, H. Sriram, A....

Date post: 03-Mar-2021
Category:
Upload: others
View: 1 times
Download: 0 times
Share this document with a friend
29
OBJECT ORIENTED MODELING AND DESIGN RT 701 2+1+0 Module 1 Introduction: object oriented development-modeling concepts – object oriented methodology – models – object oriented themes-Object Modeling– links and associations – advanced links and association concepts – generalization and inheritance - grouping constructs – a sample object model Advanced Object Modeling: aggregation – abstract classes – generalization as extension and restriction – multiple inheritance – metadata – candidate keys – constraints. Module 2 Dynamic modeling: Events and states – Operations – Nested state diagrams – Concurrency – Advanced dynamic modeling concepts – A sample dynamic model – Relationship of Object and Dynamic models. Functional modeling: Functional models – Data Flow Diagrams - Specifying operations – Constraints – A sample functional model – Relation of functional to Object and Dynamic models. Module 3 Analysis: Analysis in object modelling, dynamic modelling and functional modelling, Adding operations- Iterating the analysis System Design: Breaking system into subsystems - Identifying concurrency-allocating subsystems to processors and tasks, managing of data stores. Handling of global resources- handling boundary conditions-Common Architectural Frameworks Module 4 Object Design: Overview of Object design – Combining the three models – Designing algorithms – Design optimization – Implementation of control – Adjustment of inheritance - Design of association – Object representation – Physical
Transcript
Page 1: NSC Network · Web viewObject Oriented Analysis and Design using UML - H. Srimathi, H. Sriram, A. Krishnamoorthy Succeeding with the Booch OMT Methods -A practical approach - Lockheed

OBJECT ORIENTED MODELING AND DESIGN

RT 701 2+1+0

Module 1Introduction: object oriented development-modeling concepts – object oriented methodology – models – object oriented themes-Object Modeling– links and associations – advanced links and association concepts – generalization and inheritance - grouping constructs – a sample object modelAdvanced Object Modeling: aggregation – abstract classes – generalization as extension and restriction – multiple inheritance – metadata – candidate keys – constraints.

Module 2Dynamic modeling: Events and states – Operations – Nested state diagrams – Concurrency – Advanced dynamic modeling concepts – A sample dynamic model – Relationship of Object and Dynamic models.Functional modeling: Functional models – Data Flow Diagrams - Specifying operations – Constraints – A sample functional model – Relation of functional to Object and Dynamic models.

Module 3Analysis: Analysis in object modelling, dynamic modelling and functional modelling, Adding operations- Iterating the analysisSystem Design: Breaking system into subsystems - Identifying concurrency-allocating subsystems to processors and tasks, managing of data stores. Handling of global resources- handling boundary conditions-Common Architectural Frameworks

Module 4Object Design: Overview of Object design – Combining the three models – Designing algorithms – Design optimization – Implementation of control – Adjustment of inheritance - Design of association – Object representation – Physical packaging – Documenting design decisions-Comparison of methodologies

Module 5Other Models: Booch’s Methodology- Notations, models, concepts. Jacobson Methodology- architecture, actors and use-cases, requirement model, Analysis Model, Design model, Implementation model and Test Model-Unified Modeling Language (UML).

Page 2: NSC Network · Web viewObject Oriented Analysis and Design using UML - H. Srimathi, H. Sriram, A. Krishnamoorthy Succeeding with the Booch OMT Methods -A practical approach - Lockheed

Text Book

1. Object Oriented Modeling and Design -JamesRumbaugh, Prentice Hall India2. Object Oriented Analysis and Design with Applications - Grady Booch, Pearson

Education Asia

References

1. Object Oriented Software Engineering - Ivan Jacobson, Pearson Education Asia2. Object Oriented Software Engineering - Berno Bruegge, Allen H. Dutoit, Pearson

Education Asia3. Object Oriented Analysis and Design using UML - H. Srimathi, H. Sriram, A.

Krishnamoorthy4. Succeeding with the Booch OMT Methods -A practical approach - Lockheed Martin,

Addison Wesley5. UML and C++ practical guide to Object Oriented development - Richard C.Lee &

William, Prentice Hall India

Page 3: NSC Network · Web viewObject Oriented Analysis and Design using UML - H. Srimathi, H. Sriram, A. Krishnamoorthy Succeeding with the Booch OMT Methods -A practical approach - Lockheed

Module 1Introduction

The object oriented approach attempts to manage the complexity inherent in real world problems by abstracting out knowledge, and encapsulating it within objects.”

Wirfs-Brock, 1990

Object-oriented modeling and design is a new way of thinking about problems using models organized around real-world concepts. The fundamental construct is the object, which combines both data structure and behavior in a single entity. Object - oriented models are useful for understanding problems, communicating with application experts, modeling enterprises, pre-paring documentation, and designing programs and databases. The term Object- Oriented means that we organize software as a collection of discrete objects that incorporate both data structure and behavior. This is in contrast to conventional pro-gramming in which data structure and behavior are only loosely connected. There is some dis-pute about exactly what characteristics are required by an object-oriented approach, but they gen-erally include four aspects: identity, classification, polymorphism, and inheritance.

1. Object Oriented Development (OOD)

Object Oriented Development (OOD) has been touted as the next great advance in software engineering. It promises to reduce development time, reduce the time and resources required to maintain existing applications, increase code reuse, and provide a competitive advantage to organizations that use it. While the potential benefits and advantages of OOD are real, excessive hype has lead to unrealistic expectations among executives and managers. Even software developers often miss the subtle but profound differences between OOD and classic software development.

1.1Expected Benefits of OODMany benefits are cited for OOD, often to an unrealistic degree. Some of these potential benefits are:

Faster Development: OOD has long been touted as leading to faster development. Many of the claims of potentially reduced development time are correct in principle, if a bit overstated.

Reuse of Previous work: This is the benefit cited most commonly in literature, particularly in business periodicals. OOD produces software modules that can be plugged into one another, which allows creation of new programs. However, such reuse does not come easily. It takes planning and investment.

Increased Quality: Increases in quality are largely a by-product of this program reuse. If

Page 4: NSC Network · Web viewObject Oriented Analysis and Design using UML - H. Srimathi, H. Sriram, A. Krishnamoorthy Succeeding with the Booch OMT Methods -A practical approach - Lockheed

90% of a new application consists of proven, existing components, then only the remaining 10% of the code has to be tested from scratch. That observation implies an order-of-magnitude reduction in defects.

Modular Architecture: Object-oriented systems have a natural structure for modular design: objects, subsystems, framework, and so on. Thus, OOD systems are easier to modify. OOD systems can be altered in fundamental ways without ever breaking up since changes are neatly encapsulated. However, nothing in OOD guarantees or requires that the code produced will be modular. The same level of care in design and implementation is required to produce a modular structure in OOD, as it is for any form of software development.

Client/Server Applications: By their very nature, client/server applications involve transmission of messages back and forth over a network, and the object-message paradigm of OOD meshes well with the physical and conceptual architecture of client/server applications.

Better Mapping to the Problem Domain: This is a clear winner for OOD, particularly when the project maps to the real world. Whether objects represent customers, machinery, banks, sensors or pieces of paper, they can provide a clean, self-contained implication which fits naturally into human thought processes.

Therefore, OOD offers significant benefits in many domains, but those benefits must be considered realistically. There are many pitfalls that await those who venture into OOD development. These pitfalls threaten to undermine the acceptance and use of object-oriented development before its promise can be achieved. Due to the excitement surrounding OOD, expectations are high and delays and failures, when they come, will have a greater negative impact.

1.2 Object model concepts Three concepts are critical to understanding object models. They are:

Data abstraction Encapsulation Inheritance

1.2.1 Data Abstraction

Data abstraction is the process of distilling data down to its essentials. In an object schema, the abstract data model is implemented as a graph. The following figure (fig1.1) shows such a graph structure for a genealogical database.

“An abstraction denotes the essential characteristics of an object that distinguish it from all other kinds of objects and thus provide crisply defined conceptual boundaries, relative to the perspective of the viewer.”

Booch, 1994

Page 5: NSC Network · Web viewObject Oriented Analysis and Design using UML - H. Srimathi, H. Sriram, A. Krishnamoorthy Succeeding with the Booch OMT Methods -A practical approach - Lockheed

Fig 1.11.2.2 Encapsulation

Encapsulation is the object model concept of including processing or behaviour with the object instances defined by the class. Encapsulation allows code and data to be packaged together.

The definition of methods for a class is an integral part of encapsulation. A method is programming code that performs the behaviour an object instance can exhibit. Calculating the age of a person would be an example of such behaviour. The figure (fig 1.2)shows a way of looking at encapsulating the age method with an instance object. The code for the age method is "attached" to or encapsulated with the object rather than part of the application.

Fig 1.2

1.2.3 Inheritance Inheritance in the object model is a means of defining one class in terms of another. This

Page 6: NSC Network · Web viewObject Oriented Analysis and Design using UML - H. Srimathi, H. Sriram, A. Krishnamoorthy Succeeding with the Booch OMT Methods -A practical approach - Lockheed

is common usage for most of us. For example, a conifer is a type of tree. There are certain characteristics that are true for all trees, yet there are specific characteristics for conifers.

Note that in an object model, there is no distinction in usage between system pre-defined types and user-defined types. This is known as extensibility. So it is possible to define a type as a sub-type of a system type or as a sub-type of a user-define type.

In this example figure 1.3, a Student is a type of Person. Likewise, a Employee is a type of Person. Both Student and Employee inherit all the attributes and methods of Person. Student has a locally defined student ID attribute. Employee has a locally defined employee ID attribute. So, if you would look at a Student object, you would see attributes of name, date of birth, parents, children, and student ID.

Fig 1.3“Sharing of attributes and operations among classes based on a hierarchical relationship...”

Rumbaugh 1991

1.3 Object Model

The OMT methodology use three kinds of models to describe a system:

object model- describing the objects in the system and their relationships; dynamic mode – describing the interactions among objects in the system; functional model- describing the data transformations of the system.

Each model is applicable during all stages of development and acquires implementation de-tail as development progresses. A complete description of a system requires all three models.

The object model describes the static structure of the objects in a system and their relation-ships. The object model contains object diagrams. An object diagram is a graph whose nodes are object classes and whose arcs are relationships among classes.

Page 7: NSC Network · Web viewObject Oriented Analysis and Design using UML - H. Srimathi, H. Sriram, A. Krishnamoorthy Succeeding with the Booch OMT Methods -A practical approach - Lockheed

The dynamic model describes the aspects of a system that change over time. The dynamic model is used to specify and implement the control aspects of a system. The dynamic model con-tains state diagrams. A state diagram is a graph whose nodes are states and whose arcs are tran-sitions between states caused by events.

The functional model describes the data value transformations within a system. The func-tional model contains data flow diagrams. A data flow diagram represents a computation. A data flow diagram is a graph whose nodes are processes and whose arcs are data flows.

The object model is most fundamental, however, because it is necessary to describe what is changing or transforming before describing when or how it changes.

1.4 OBJECT-ORIENTED THEMES

There are several themes underlying object-oriented technology

AbstractionAbstraction consists of focusing on the essential, inherent aspects of an entity and ignor-

ing its accidental properties. In system development, this means focusing on what an object is and does, before deciding how it would be implemented. Use of abstraction during analysis means dealing only with application-domain concepts, not making design and implementation decisions before the problem is understood. Proper use of abstraction allows the same model to be used for analysis, high-level design, program structure, database structure, and documenta-tion.

Encapsulation

Encapsulation (also information hiding) consists of separating the external aspects of an object, which are accessible to other objects, from the internal implementation details of the object, which are hidden from other objects.

Combining Data and Behavior

The caller of an operation need not consider how many implementations of a given oper-ation exist. Operator polymorphism shifts the burden of deciding what implementation to use from the calling code to the class hierarchy.

Fig 1.4 An object-oriented approach has one unified hierarchy

Page 8: NSC Network · Web viewObject Oriented Analysis and Design using UML - H. Srimathi, H. Sriram, A. Krishnamoorthy Succeeding with the Booch OMT Methods -A practical approach - Lockheed

For example, non-object-oriented code to display the contents of a window must distin-guish the type of each figure, such as polygon, circle, or text, and call the appropriate procedure to display it. An object-oriented program would simply invoke the draw operation on each fig-ure; the decision of which procedure to use is made implicitly by each object, based on its class. It is unnecessary to repeat the choice of procedure every time the operation is called in the appli-cation program. Maintenance is easier, because the calling code need not be modified when a new class is added. In an object oriented system, the data structure hierarchy is identical to the operation inheritance hierarchy (Figure 1.4).

Sharing

Object-oriented techniques promote sharing at several different levels. Inheritance of both data structure and behavior allows common structure to be shared among several similar subclasses without redundancy. The sharing of code using inheritance is one of the main advan-tages of object-oriented languages.

Object-oriented development not only allows information to be shared within an applica-tion, but also offers the prospect of reusing designs and code on future projects. Although this possibility has been overemphasized as a justification for object-oriented technology, object - oriented development provides the tools, such as abstraction, encapsulation, and inheritance, to build libraries of reusable components.

Emphasis on Object Structure, Not Procedure Structure

Object-oriented technology stresses specifying what an object is, rather than how it is used. The uses of an object depend highly on the details of the application and frequently change during development. As requirements evolve, the features supplied by an object are much more stable than the ways it is used; hence software systems built on object structure are more stable in the long run [Booch-86]. Object-oriented development places a greater emphasis on data structure and a lesser emphasis on procedure structure than traditional functional- decomposition methodologies.

Synergy

Identity, classification, polymorphism, and inheritance characterize mainstream object-oriented languages. Each of these concepts can be used in isolation, but together they comple-ment each other synergistically.

1.5 Object Modelling

An object model captures the static structure of a system by showing the objects in the system, relationships between the objects, and the attributes and operations that characterize each class of objects. We emphasize building a system around objects rather than around functional-ity, because an object oriented model more closely corresponds to the real world and is conse-quently more resilient with respect to change.

Object models provide an intuitive graphic representation of a system and are valuable for communicating with customers and documenting the structure of a system. Some basic con-cepts covered in object modelling.

1.5.1 Objects and Classes

Objects

We can define an object as a concept, abstraction, or thing with crisp boundaries and meaning

Page 9: NSC Network · Web viewObject Oriented Analysis and Design using UML - H. Srimathi, H. Sriram, A. Krishnamoorthy Succeeding with the Booch OMT Methods -A practical approach - Lockheed

for the problem at hand. All objects have identity and are distinguishable. The term identity means that objects are distinguished by their inherent existence and not by descriptive properties that they may have.

The word object is often vaguely used in the literature. Sometimes object means a single thing, other times it refers to a group of similar things. When we want to be precise and refer to exactly one thing, we will use the phrase object instance. We will use the phrase object class to refer to a group of similar things.eg:- Two apples can be described as 2 different objects even though they have the same descriptive properties.

Classes

An ‘object class’ or ‘class’ describes a group of objects with similar properties, common behaviour, common relationships to other objects, and common semantics. Person, company, animal, process, and window are all object classes. Each person has an age, IQ, and may work at a job. Each process has an owner, priority, and list of required resources. Objects and object classes often appear as nouns in problem descriptions.

The abbreviation class is often used instead of object class. Objects in a class have the same attributes and behavior patterns.

eg: - Suppose you have a person class –you can term J S, M S, etc. to be objects of that class.

Fig.1.5 Classes and Objects

Object Diagrams

Object Diagram provides a formal graphic notation for modelling objects, classes and their rela-tionships to one another. Object diagrams are concise, easy to understand, and work well in prac-tice. There are two types of object diagrams: class diagrams and instance diagrams.

Class Diagram: It is a schema, pattern or template for describing many possible instances of

data. A class diagram describes object classes.

Page 10: NSC Network · Web viewObject Oriented Analysis and Design using UML - H. Srimathi, H. Sriram, A. Krishnamoorthy Succeeding with the Booch OMT Methods -A practical approach - Lockheed

An instance diagram describes how a particular set of objects relate to each other. An in-stance diagram describes object instances. A given class diagram corresponds to an infinite set of instance diagrams.

Fig 1.6 Class and objectsFigure 1.6 shows a class diagram (left) and one possible instance diagram (right) described

by it. Objects Joe Smith, Mary Sharp, and an anonymous person are instances of class Person. The OMT symbol for an object instance is a rounded box. The class name in parentheses is at the top of the object box in boldface. Object names are listed in normal font. The OMT symbol for a class is a box with class name in boldface.

Attributes

An attribute is a data value held by objects in a class. Name, age and weight are the at-tributes of Person objects Color, weight, and model-year are attributes of Car objects. Each at-tribute has a value for each object instance. Each attributes is unique within a class.Attributes are listed in the second part of the class box. So in the above example,

Fig.1.7 Attributes and values

(e) Operations and methods: An operation is a function or transformation that may be applied to or by objects in a class. Operations are listed in the lower third of the class box.Eg: - consider the above example, change –job and change-address on Person class.

Page 11: NSC Network · Web viewObject Oriented Analysis and Design using UML - H. Srimathi, H. Sriram, A. Krishnamoorthy Succeeding with the Booch OMT Methods -A practical approach - Lockheed

Fig.1.8 Operations

Each attribute name may be followed by operational details, list of attributes and list of op-erations. Each operation name may be followed by operational details such as operational details

such as argument list and result type.Links and associations: They are used for establishing relationships among objects and

classes. Link- A link is a physical or conceptual connection between object instances .We can say that

a link is an instance of an association.Eg: - J S works for Simplex company.Association –Describes a group of links with common structure and common semantics’:- A person works for a company.

They are inherently bidirectional. It means that a binary association can be traversed in both directions. They are implemented as pointers.

The below figure shows a 1-1 association and corresponding links.

Fig. 1.9 Class Diagram

Fig.1.10 Instance Diagram

Multiplicity –specifies how many instances of one class may relate to each in-

stance of another class. The solid balls,”2+” are multiplicity symbols. Associations may be bin-

ary, ternary or higher order.

Page 12: NSC Network · Web viewObject Oriented Analysis and Design using UML - H. Srimathi, H. Sriram, A. Krishnamoorthy Succeeding with the Booch OMT Methods -A practical approach - Lockheed

Fig.1.11 Ternary associations and links

Advanced Link and Association Concepts:

i) Link Attributes –A link attribute is a property of the links in an association. In the below figure

access permission is an attribute of ‘Accessible by’.

Fig.1.12 Link attribute for a many-many association

* The OMT notation for a link attribute is a box attached to the association by a loop

ii) Role names – A role is an end of an association. Role name is a name that uniquely identifies

one end of an association.

Eg: - “Person works for a Company.” Here the person plays the role of an employee and the

company the role of the employer.

Fig.1.13 Role names for an association

iii) Ordering -Sometimes, the objects are explicitly ordered. For example, the figure below shows

a workstation screen containing a number of overlapping windows. The windows are explicitly

ordered, so only the topmost window is visible at any point on the screen.

Page 13: NSC Network · Web viewObject Oriented Analysis and Design using UML - H. Srimathi, H. Sriram, A. Krishnamoorthy Succeeding with the Booch OMT Methods -A practical approach - Lockheed

Fig.1.14 Ordered sets in an association

iv) Qualification – Qualifier is a special attribute that reduces the effective multiplicity of an

association. It reduces the effective multiplicity of an association. We can qualify a one to many

and many to many association.

For eg: - In the below figure a directory has many files .A file may only belong to a single

directory. Within the context of a directory, the file name specifies a unique file .A file

corresponds to a directory and a file name.

Fig.1.15 A qualified association

(v) Aggregation: Aggregation is the “part-whole” relationship in which objects representing the components of something are associated with an object representing the entire assembly. The figure shows a portion of an object model for a word processing. Here a document consists of many paragraphs, each of which consists of many sentences.

Fig. 1.16 Aggregation

Generalization and Inheritance: Generalization 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

Page 14: NSC Network · Web viewObject Oriented Analysis and Design using UML - H. Srimathi, H. Sriram, A. Krishnamoorthy Succeeding with the Booch OMT Methods -A practical approach - Lockheed

version are called a ‘subclass’. For example, Equipment is the superclass of Pump and tank. At-tributes and operations that are common to a group of subclasses are attached to the superclass and shared by each subclass. Generalization is sometimes called a ‘is-a’ relationship. Each in-stance of a subclass is an instance of the superclass. The notation for generalization is a triangle connecting a superclass to subclass.

Fig. 1.17 An inheritance hierarchy

The dangling ellipsis in the above figure indicates that there are additional subclasses that are not shown in the diagram. This may be since there is no room on the sheet and they are shown elsewhere or may be because enumeration of subclasses is still incomplete. You can also see equipment type written next to the triangle. This is called as a discriminator.“A discriminator is an attribute of enumeration type that indicates which property of an object is being abstracted by a particular generalization relationship.”What is the use of generalization? Generalization is a useful construct for both conceptual modeling and implementation.Overriding Features:I think you are all familiar with this term. A subclass may override a superclass feature by defining a feature with the same name. Here you can see that the subclass feature refines and replaces the superclass feature. What is the need for this feature? The reasons are many to specify be-havior that depends on the subclass to tighten the specifica- tion of a fea-ture. better per-formance

Page 15: NSC Network · Web viewObject Oriented Analysis and Design using UML - H. Srimathi, H. Sriram, A. Krishnamoorthy Succeeding with the Booch OMT Methods -A practical approach - Lockheed

Fig. 1.18 Inheritance for graphic figures

In the above figure, you can see that display must be implemented separately for each kind of figure, although it is defined for any kind of figure.(ii) Grouping Constructs: a) Module- A module is a logical construct for grouping classes, associations, and generalizations. It captures one view of a situation.For example: Let us say, electrical, plumbing, etc. are different views of a building.An object model consists of one or more modules. Class names and association names must be unique within a module. Module names are usually listed at the top of each sheet. The same class may be referenced in many modules.b) Sheet- A sheet is a mechanism for breaking a large object model down into a series of pages. A sheet is a single printed page. Each module consists of one or more sheets.Each sheet has a title and a name or number. Each association/generalization appears on a single sheet. Classes may appear on multiple sheets.(iii) Sample Model: For the sample model you please look through the text book. It shows an object model of a workstation window management system.Aggregation –I think by now, all of you know what is an aggregation? It is a strong form of association in which an aggregate is made of components. Components are part of the aggregate. Aggregation vs. Association –Aggregation is a special form of association not an independ-ent concept. If two objects are bound by a part-whole relationship, it is an aggregation .If two ob-jects are usually considered independent, even though they may be linked, it is an association. Some possible tests are:i) Would you use the phrase part of?

ii) Are some operations on the whole automatically applied to its parts?iii) Are some attribute values propagated from the whole to all or some partsiv) Is there an intrinsic asymmetry to the association, where one object class is subordinate to the other?

Page 16: NSC Network · Web viewObject Oriented Analysis and Design using UML - H. Srimathi, H. Sriram, A. Krishnamoorthy Succeeding with the Booch OMT Methods -A practical approach - Lockheed

Fig.1.19 Aggregation and association

In the figure, a company is an aggregation of its divisions, which in turns aggregations of departments; a company is indirectly an aggregation of departments.The decision to use aggregation is a matter of judgment and is often arbitrary.

Aggregation vs. Generalization- Aggregation is not the same as generalization. Aggregation relates instances .Two distinct objects are involved; one of them part of other. While generaliza-tion relates classes and is a way of structuring the description of a single object. With generaliza-tion, an object is simultaneously an instance of the superclass and an instance of the subclass.Aggregation is called “a part of” relationship; generalization is often called “a kind of” or “is-a “relationship.

Fig.1.20. Aggregation and generalization

The above figure shows the aggregation and generalization in the case of a desk lamp.Aggregation is sometimes called an “and-relationship” and generalization an “or-relationship”. Recursive Aggregates Aggregation can be fixed, variable or recursive. A fixed aggregate has a fixed structure; the number and types of subparts are predefined.

The desk lamp in figure 1.19 is a fixed aggregate. A variable aggregate has a finite number of levels, but the number of parts may vary. The

Company in Fig.1.20 is a variable aggregate. A recursive aggregate contains, directly or indirectly, an instance of the same kind of

aggregate; the number of potential levels is unlimited.Fig1.21 shows a recursive aggregate.

Page 17: NSC Network · Web viewObject Oriented Analysis and Design using UML - H. Srimathi, H. Sriram, A. Krishnamoorthy Succeeding with the Booch OMT Methods -A practical approach - Lockheed

Fig.1.21 Recursive Aggregates

Propagation of Operations-Propagation (also called triggering) is the automatic application of an operation to a network of objects when the operation is applied to some starting ob-ject. For example, moving an aggregate moves its parts; the move operation propagates to the parts. The below figure shows propagation.

Fig.1.22 Propagation of operations

Here, let us say a person owns multiple documents .Each document is composed of paragraphs that are in turn composed of characters. The copy operation propagates from documents to paragraphs to characters. It means that by copying a paragraph, all the characters in it are copied. It does not propagate in the reverse direction. The propagation is indicated with a small arrow and operation name next to the affected association.(ii) Abstract Classes- An abstract class is a class that has no direct instances but whose descendent classes have direct instances.A concrete class is a class that is an instantiable; that is, it can have direct instances. A concrete class may be leaf classes in the inheritance tree; only concrete classes may be leaf classes in the inheritance tree. Now to get a clear idea about look at the below figure.

Page 18: NSC Network · Web viewObject Oriented Analysis and Design using UML - H. Srimathi, H. Sriram, A. Krishnamoorthy Succeeding with the Booch OMT Methods -A practical approach - Lockheed

Fig.1.23 Object model defining abstract and concrete class

Fig 1.24 Concrete classes

All the classes are concrete classes.

Fig.1.25 abstract class and abstract operation

Page 19: NSC Network · Web viewObject Oriented Analysis and Design using UML - H. Srimathi, H. Sriram, A. Krishnamoorthy Succeeding with the Booch OMT Methods -A practical approach - Lockheed

Generalization as Extension and Restriction: By now you are all familiar with what is meant by generalization.In generalization, an instance of a class is an instance of a class is an instance of all ancestors of the class. Therefore you can say that all ancestor class features must apply to the subclass instances. This includes not only the attributes on the ancestor classes but also the operations on the ancestor class.A subclass may include many features, which is called as an extension. For example, fig.4.7 extends class Employee with three subclasses that inherit all Employee features and add new features of their own.A subclass may also constrain ancestor attributes. This is called restriction because it restricts the values that instances can assume. For example, a circle is an ellipse whose major and minor axes are equal.Arbitary changes to the attribute values of a restricted subclass may cause it to violate the constraints, such that the result no longer belongs to the original subclass. This is not a problem from the perspective of the superclass because the result is still a valid superclass instance. For example, a circle that is scaled unequally in the x and y dimensions remains an ellipse but is no longer a circle.* The inherited features can be renamed in a restrictionFor example, the inherited features can be renamed the diameter.Class membership can be defined in two ways: implicitly by rule or explicitly by enumeration.Overriding Operations:Overriding is done for many reasons:

Overriding for Extension: For example, suppose say you have a Window superclass and a Win-dow Labeled subclass. Now this superclass has draw operations that is used to draw the Window boundary and contents. The subclass has an operation draw-Labeled Window. The method could be invoked by invoking the method to draw a window and then adding a code to draw the label.

Overriding for Restriction: This is quite necessary when you have to keep the inherited opera-tions closed within the subclass. For example, the suprclass Set may have the operation add(object).the subclass IntegerSet would then have the more restrictive operation add(integer).

Overriding for Optimization:: Overriding for Convinience:

(ii) Multiple Inheritance: It permits a class to have more than one superclass and to inherit features from all parents. It rathers allows mixing of information from two or mores sources. Now what is the advantage of multiple inheritance?Well it provides increased opportunity for reuse. And to speak about its disadvantage, is a loss of conceptual and implementation simplicity.Definition:A class may inherit features from more than one class. A class with more than one superclass is called a join class. A feature from the same ancestor class found along more than one path is inherited only once; it is the same feature. Conflicts among parallel definitions create ambiguities that must be resolved in implementation.

Page 20: NSC Network · Web viewObject Oriented Analysis and Design using UML - H. Srimathi, H. Sriram, A. Krishnamoorthy Succeeding with the Booch OMT Methods -A practical approach - Lockheed

Fig. 1.26 Multiple inheritance from disjoint classes

Here in the above example, Amphibious Vehicle is a join class. If a class can be refined on several distinct and independent dimensions, then use multiple generalizations.Accidental Multiple Inheritance

An instance of a join class is inherently an instance of all the ancestors of the join class. For example, an instructor is inherently both faculty and student. But suppose lets say about a professor at HV taking classes at MIT.You can see there is no class to describe the combination .This is a case of accidental multiple inheritance.

Fig. Workaround for accidental multiple inheritance

Metadata-is data that describes other data. For example, the definition of a class is metadata. Models are inherently metadata, since they describe the things being modeled.(ii) Candidate Keys – It is a minimal set of attributes that uniquely identifies an object or link. It means you can’t discard an attribute from the candidate key and still distinguish all objects and links. A class or association may have one or more candidate keys, each of which may have different combinations and numbers of attributes. The object id is always a candidate key for a class. One or more combinations of related objects are candidate keys for associations. A candidate key is delimited with braces in an object model.

Page 21: NSC Network · Web viewObject Oriented Analysis and Design using UML - H. Srimathi, H. Sriram, A. Krishnamoorthy Succeeding with the Booch OMT Methods -A practical approach - Lockheed

Fig. Comparison of multiplicity with candidate keys for binary associations

(iii) Constraints: They are functional relationships between entities of an object model


Recommended