




























































































Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
Prepare for your exams
Study with the several resources on Docsity
Earn points to download
Earn points by helping other students or get them with a premium plan
Book Object Oriented Analysis and Design
Typology: Lecture notes
1 / 188
This page cannot be seen from the preview
Don't miss anything!





























































































Copyright © 2013 Anindita Hazra All rights reserved
Produced & Printed by EXCEL BOOKS PRIVATE LIMITED A-45, Naraina, Phase-I, New Delhi- for Directorate of Distance Education Lovely Professional University Phagwara
Objectives:
To enable the student to understand the concept of Object Oriented Analysis and Design.
To impart the skills required for modelling.
To enable the student to implement generalization and inheritance class modeling.
To enable the student to implement association and aggregation using modeling.
To enable the student to implement state modeling
To enable the student to implement interactive modeling.
To enable the student to implement procedural and activity models.
To impart the skills needed to perform system analysis and design.
To enable the student to implement domain analysis.
To enable the student to understand the technicalities of system design concepts.
To enable the student to design class diagrams.
Sr. No. Description
Unit 1: Introduction to Object Orientation
Unit 1: Introduction to Object Orientation^ Notes
Objectives Introduction
1.1 Object Orientation (OO) 1.1.1 Uses of Object Orientation
1.1.2 Why Object Orientation? 1.2 Object-oriented Development
1.3 Object-oriented Themes 1.3.1 Abstraction
1.3.2 Encapsulation 1.3.3 Combining Data and Behaviour
1.3.4 Sharing 1.3.5 Emphasis on Object Structure, not on Operation Implementation
1.4 Evidence for Usefulness of Object-oriented Development 1.5 Summary
1.6 Keywords 1.7 Review Questions
1.8 Further Readings
After studying this unit, you will be able to:
Describe the concept of object orientation
Discuss the uses and need of object orientation
Explain the concept of object-oriented development
Identify object-oriented themes
Discuss the evidence for usefulness of object-oriented development
Object-oriented Analysis and Design (OOAD) is a software engineering model which makes use of objects, classes, state, methods and behavior concepts to analyze and demonstrate system structure, functional needs and behavior. While object-oriented analysis emphasizes the things that a system actually does, the object oriented design is concerned with the manner in which the system does it. One thing that you must keep in mind is that the object oriented system will always be comprised of objects. The behavior for the system is a result for the connection that is made with the objects. Connections between objects will require them to send out messages to
Notes (^) one another. The object-oriented paradigm is currently the most popular way of analysing, designing, and developing application systems, especially large ones. Labelling something as ‘object-oriented’ implies that objects play a central role, and we elaborate this further as a perspective that views the elements of a given situation by decomposing them into objects and object relationships. In this unit, we will discuss the concept of object orientation and discuss object oriented development and object oriented themes.
In the past, information systems used to be defined primarily by their functionality: data and functions were kept separate and linked together by means of input and output relations. Object-oriented Approach means organizing software as a collection of discrete objects that incorporate both data structure and behavior. The object-oriented approach, however, focuses on objects that represent abstract or concrete things of the real world. These objects are first defined by their character and their properties which are represented by their internal structure and their attributes (data). The behaviour of these objects is described by methods (functionality). Object orientation (OO), or to be more precise, object-oriented programming, is a problem-solving method in which the software solution reflects objects in the real world. The term object-oriented (OO) signifies that we organize software as a collection of discrete objects that incorporate both data structure and behavior. This contrasts with previous programming approaches in which data structure and behavior are only loosely connected. There is some dispute regarding exactly what characteristics are needed by an object oriented approach, however they generally include aspects such as identity, classification, inheritance, polymorphism, etc. Terms that are used universally in object orientation are: Objects: An object is a section of source code that contains data and provides services. The data forms the attributes of the object. The services are known as methods (also known as operations or functions). Typically, methods operate on private data (the attributes, or state of the object), which is only visible to the methods of the object. Thus the attributes of an object cannot be changed directly by the user, but only by the methods of the object. This guarantees the internal consistency of the object. Objects are a concept, abstraction, or item with clear boundaries and meaning for the problem domain. Objects have: Unique identity State Behavior Objects can be concrete or conceptual, conceptual objects are pure abstractions that serve some specific purpose for a system. Objects are instances of classes. The set of activities that the object performs defines the object’s behavior.
Example: A “StudentStatus” object can tell you its grade point average, year in school, or can add a list of courses taken. A “Student” object can tell you its name or its address. Classes: Classes describe objects. From a technical point of view, objects are runtime instances of a class. In theory, you can create any number of objects based on a single class.
Object Oriented Analysis and Design
Notes (^) Each object “knows how to perform its operation.” This burden is on the class and not the caller of the operation. OOP selects the method to implement an operation based on the name and class of the operation. The user of an operation need not be aware of implementation details. Inheritance: Inheritance is a mechanism for sharing similarities among classes while preserving their differences. Classes are typically defined broadly (higher level of abstraction) and then refined into subclasses (lower level of abstraction). Each subclass “inherits” all of the properties of the superclass and adds its own unique properties. You can use an existing class to derive a new class. Derived classes inherit the data and methods of the superclass. However, they can overwrite existing methods, and also add new ones. Properties (both data and behavior) of the superclass need not be repeated in the subclass. The ability to abstract common properties of several classes into one common superclass and inherit the properties from the superclass can greatly reduce repetition within designs and programs (at the cost of coupling).
Example: Class ‘employee’ and class ‘customer’ are derived from the class ‘person’ New classes can be added without changing code given that methods are provided for each applicable operation on the new class. Inheritance is used to model an “is a” relationship. A subclass is always an instance of the superclass.
! Caution (^) Be careful, the reverse is not true.
Task (^) Explain the concept of “Identity” with example.
Below are some of the advantages of object-oriented programming: Complex software systems become easier to understand, since object-oriented structuring provides a closer representation of reality than other programming techniques. In a well-designed object-oriented system, it should be possible to implement changes at class level, without having to make alterations at other points in the system. This reduces the overall amount of maintenance required. Through polymorphism and inheritance, object-oriented programming allows you to reuse individual components. In an object-oriented system, the amount of work involved in revising and maintaining the system is reduced, since many problems can be detected and corrected in the design phase. Achieving these goals requires: Object-oriented programming languages: Object-oriented programming techniques do not necessarily depend on object-oriented programming languages. However, the efficiency
Unit 1: Introduction to Object Orientation
of object-oriented programming depends directly on how object-oriented language^ Notes techniques are implemented in the system kernel.
Object-oriented tools: Object-oriented tools allow you to create object-oriented programs in object-oriented languages. They allow you to model and store development objects and the relationships between them.
Object-oriented modelling: The object-orientation modeling of a software system is the most important, most time-consuming, and most difficult requirement for attaining the above goals. Object-oriented design involves more than just object-oriented programming, and provides logical advantages that are independent of the actual implementation.
To create sets of objects that work together concurrently to produce s/w that better, model their problem domain that similarly system produced by traditional techniques.
It adapts to:
(a) Higher level of abstraction (b) Seamless transition among different phases of software development (c) Encouragement of good programming techniques (d) Promotion of reusability
Fill in the blanks:
Unit 1: Introduction to Object Orientation
Some of the pioneers in the field of software design began to ask whether they could not also^ Notes design software using such ‘off-the-shelf’ components. The object-oriented paradigm one could argue has really evolved in response to this outlook. There are, of course, several differences with the hardware design process (inevitable, because the nature of software is fundamentally different from hardware), but parallels can be drawn between many of the defining characteristics of hardware design and what today’s advocates of good software design recommend. This methodology provides us with a step-by-step process for software design, a language to specify the output from each step of the process so that we can transition smoothly from one stage to the next, the ability to reuse earlier designs, standard solutions that adhere to well-reasoned design principles and, even the ability to incrementally fix a poor design without breaking the system.
The overall philosophy here is to define a software system as a collection of objects of various types that interact with each other through well-defined interfaces. Unlike a hardware component, a software object can be designed to handle multiple functions and can therefore participate in several processes.
Notes (^) A software component is also capable of storing data, which adds another dimension of complexity to the process.
The manner in which all of this has departed from the traditional process-oriented view is that instead of implementing an entire process end-to-end and defining the needed data structures along the way, we first analyse the entire set of processes and from this identify the necessary software components. Each component represents a data abstraction and is designed to store information along with procedures to manipulate the same. The execution of the original processes is then broken down into several steps, each of which can be logically assigned to one of the software components.
Did u know? (^) The components can also communicate with each other as needed to complete the process.
Fill in the blanks:
There are several themes in an object oriented technology. These themes are not unique to object oriented systems. We can see some important themes:
Abstraction consists of focusing on the essential, inherent aspects of an entity and ignoring its accidental aspects. Use of abstraction preserves the freedom to make decisions as long as possible by avoiding premature commitments to details. Most modern languages provide data abstraction,
Object Oriented Analysis and Design
Notes (^) but inherit-mice and polymorphism add power. The ability to abstract is probably the most important skill required for object oriented development.
Encapsulation is the process of encapsulating the elements of an abstraction that constitutes its structure and behavior; encapsulation serves to separate the contractual interface of an abstraction and its implementation. It can also be called as information hiding. It 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. It is not unique to object oriented languages. Encapsulation (also information hiding) consists of separating the external aspects of an object, which are accessible to other objects, from the internal details of the object, which are hidden from other objects. Objects have an outside (how they are seen or interact) and an inside (what they are.) Encapsulation means that every object is self-contained. Encapsulation is not a unique concept to OO languages, but the ability to combine data and behavior in an object provides cleaner encapsulations than with conventional languages. Objects restrict the visibility of their resources (attributes and methods) to other users. Every object has an interface, which determines how other objects can interact with it. The implementation of the object is encapsulated, that is, invisible outside the object itself. Separate the external aspects of an object (its interface) from the internal implementation details (implementation). Proper encapsulation keeps objects from becoming interdependent (or coupled) - internal details can change with no affect on the user. Encapsulation places a premium on interfaces.
! Caution (^) Encapsulated details can change with no impact to a client, while an interface change directly affects a client.
The caller of an operation need not consider how many implementations of a given operation exist. Operator polymorphism shifts the burden of deciding what implementation to use from the calling code to the class hierarchy. As an example, let us talk about an object oriented program calling a draw procedure for drawing different figures say a polygon, circle, or text. The decision of which procedure to use is made by each object, based on its class.
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 advantages of object oriented languages. One of the reasons for the popularity of object-oriented techniques is that they encourage sharing at different levels. Inheritance of both data structure and behavior allows common structure (base class) to be used in designing many subclasses based on basic characteristics of base class,
Object Oriented Analysis and Design
Notes (^) Since the mid 1990s, we have expanded our practice of object oriented technology beyond General Electric to companies throughout the world. Earlier object orientation and object oriented modeling were relatively new approaches without much large-scale experience.
Notes (^) Object oriented technology can no longer be considered a fad or a speculative approach. It is now part of the computer science and software engineering mainstream.
The annual OOPSLA (Object-oriented Programming Systems, Languages, and Applications), ECOOP (European Conference on Object-oriented Programming), and TOOLS (Technology of Object-oriented Languages and Systems) conferences are important forums for disseminating new object oriented ideas and application results. The conference proceedings describe many applications that have benefited from an object oriented approach. Advantages of OO Development are: Reusability Effective maintenance Disadvantage of OO Development: Not applicable in performance critical rather than data.
State whether the following statements are true or false:
Object-oriented analysis and design is a software engineering model which makes use of objects, classes, state, methods and behavior concepts to analyze and demonstrate system structure, functional needs and behavior. Object Oriented Approach means organizing software as a collection of discrete objects that incorporate both data structure and behavior. Object orientation (OO), or to be more precise, object-oriented programming, is a problem- solving method in which the software solution reflects objects in the real world. An object is a section of source code that contains data and provides services. A class is a definitive description of a group of objects with similar properties and behaviors. Object Oriented Development is a new way of thinking about software based on abstractions that exist in the real world as well as in the program. Abstraction consists of focusing on the essential, inherent aspects of an entity and ignoring its accidental aspects. Encapsulation is the process of encapsulating the elements of an abstraction that constitutes its structure and behavior.
Unit 1: Introduction to Object Orientation
Inheritance of both data structure and behavior allows a common structure and behavior^ Notes allows common structure to be shared among several similar subclasses without redundancy. In object orientation the major emphasis is on specifying the characteristics of the objects in a system, rather than implementing these characteristics.
Abstraction: Abstraction consists of focusing on the essential, inherent aspects of an entity and ignoring its accidental aspects. Class: A class or object class is a group of objects with similar properties (attributes), common behavior (operations), common relationships to other objects, and common semantics. Classification: Classification means that objects with the same data structure (attributes) and behavior (operations) are grouped into a class. Encapsulation: Encapsulation is the process of encapsulating the elements of an abstraction that constitutes its structure and behavior.
Identity: Identity means that data is quantized into discrete, distinguishable entities called objects.
Inheritance: Inheritance is a mechanism for sharing similarities among classes while preserving their differences.
Object: An object is a section of source code that contains data and provides services.
OO Development: Object-oriented Development is a new way of thinking about software based on abstractions that exist in the real world as well as in the program.
Unit 2: Modelling Concepts^ Notes
Objectives Introduction
2.1 Basics of Object-oriented Analysis and Design (OOAD) 2.1.1 Object-oriented Analysis (OOA)
2.1.2 Object-oriented Design (OOD) 2.2 Modelling
2.2.1 Definition of Modelling 2.2.2 Why do we Model?
2.2.3 Object-oriented Modelling (OOM) 2.2.4 Benefits of Object-oriented Modelling
2.3 Abstraction 2.4 Three Models
2.5 Summary 2.6 Keywords
2.7 Review Questions 2.8 Further Readings
After studying this unit, you will be able to:
Describe the basics of Object-oriented Analysis and Design
Discuss the concept of modelling
Explain abstraction
Discuss three models used in object-oriented modelling
Object oriented design methods emerged in the 1980s, and object oriented analysis methods emerged during the 1990s. In the early stage, object orientation was largely associated with the development of Graphical User Interfaces (GUIs), and a few other applications became widely known. In the 1980s, Grady Booch published a paper on how to design for Ada and gave it the title, Object Oriented Design. In 1991, Booch was able to extend his ideas to a genuinely object oriented design method with the same title, revised in 1993. The Object Modelling Technique (OMT) covers aspects of object oriented analysis and design. OOT provides a very productive and practical way of software development. As Object-oriented Technology (OOT) is not language dependent, there is no need for considering a final implementation language, during Object-oriented Modelling (OOM). OOT combines structural, control and functional aspects of the system.
Object Oriented Analysis and Design
Object-oriented Analysis and Design is a software engineering approach that models a system as a group of interacting objects. Each object represents some entity of interest in the system being modeled, and is characterized by its class, its state (data elements), and its behavior. Various models can be created to show the static structure, dynamic behavior, and run-time deployment of these collaborating objects. There are a number of different notations for representing these models, such as the Unified Modeling Language (UML). Object-oriented Analysis (OOA) applies object-modeling techniques to analyze the functional requirements for a system. Object-oriented Design (OOD) elaborates the analysis models to produce implementation specifications. OOA focuses on what the System Does, OOD on How the System Does it. An object-oriented system is composed of objects. The behavior of the system results from the collaboration of those objects. Collaboration between objects involves them sending messages to each other. Sending a message differs from calling a function in that when a target object receives a message, it itself decides what function to carry out to service that message. The same message may be implemented by many different functions, the one selected depending on the state of the target object. The implementation of “message sending” varies depending on the architecture of the system being modeled, and the location of the objects being communicated with.
Object-oriented Analysis looks at the problem domain, with the aim of producing a conceptual model of the information that exists in the area being analyzed. Analysis models do not consider any implementation constraints that might exist, such as concurrency, distribution, persistence, or how the system is to be built. Implementation constraints are dealt with during Object- oriented Design. Analysis is done before the Design. The sources for the analysis can be a written requirements statement, a formal vision document, and interviews with stakeholders or other interested parties.
Did u know? (^) A system may be divided into multiple domains, representing different business, technological, or other areas of interest, each of which are analyzed separately. The result of object-oriented analysis is a description of what the system is functionally required to do, in the form of a conceptual model. That will typically be presented as a set of use cases, one or more UML class diagrams, and a number of interaction diagrams. It may also include some kind of user interface mock-up.
Object-oriented Design transforms the conceptual model produced in object-oriented analysis to take account of the constraints imposed by the chosen architecture and any non-functional – technological or environmental – constraints. Examples of non-functional constraints include transaction throughput, response time, run-time platform, development environment, or programming language. The concepts in the analysis model are mapped onto implementation classes and interfaces. The result is a model of the solution domain, a detailed description of how the system is to be built.