Ise vii object oriented modeling and design [10cs71] notes, Study notes of Computer Science

object oriented design and modelling

Typology: Study notes

2014/2015

Uploaded on 06/04/2015

snehaewis104
snehaewis104 🇮🇳

1 document

1 / 167

Toggle sidebar

This page cannot be seen from the preview

Don't miss anything!

bg1
Object Oriented Modeling and Design 10CS71
Dept. of ISE, SJBIT Page 1
OBJECT ORIENTED MODELING AND DESING
Subject Code: 10CS71 I.A. Marks : 25
Hours/Week : 04 Exam Hours: 03
Total Hours : 52 Exam Marks: 100
PART - A
UNIT - 1 7 Hours
INTRODUCTION, MODELING CONCEPTS, CLASS MODELING: What is
Object Orientation? What is OO development? OO themes; Evidence for usefulness
of OO development; OO modeling history. Modeling as Design Technique:
Modeling; abstraction; The three models. Class Modeling: Object and class
concepts; Link and associations concepts; Generalization and inheritance; A sample
class model; Navigation of class models; Practical tips.
UNIT - 2 6 Hours
ADVANCED CLASS MODELING, STATE MODELING: Advanced object and
class concepts; Association ends; N-ary associations; Aggregation; Abstract classes;
Multiple inheritance; Metadata; Reification; Constraints; Derived data; Packages;
Practical tips. State Modeling: Events, States, Transitions and Conditions; State
diagrams; State diagram behavior; Practical tips.
UNIT - 3 6 Hours
ADVANCED STATE MODELING, INTERACTION MODELING: Advanced
State Modeling: Nested state diagrams; Nested states; Signal generalization;
Concurrency; A sample state model; Relation of class and state models; Practical
tips. Interaction Modeling: Use case models; Sequence models; Activity models. Use
case relationships; Procedural sequence models; Special constructs for activity
models.
UNIT - 4 7 Hours
PROCESS OVERVIEW, SYSTEM CONCEPTION, DOMAIN ANALYSIS:
Process Overview: Development stages; Development life cycle. System
Conception: Devising a system concept; Elaborating a concept; Preparing a problem
statement. Domain Analysis: Overview of analysis; Domain class model; Domain
state model; Domain interaction model; Iterating the analysis.
PART - B
UNIT - 5 7 Hours
APPLICATION ANALYSIS, SYSTEM DESIGN: Application Analysis:
Application interaction model; Application class model; Application state model;
Adding operations. Overview of system design; Estimating performance; Making a
reuse plan; Breaking a system in to sub-systems; Identifying concurrency; Allocation
of sub-systems; Management of data storage; Handling global resources; Choosing a
www.rejinpaul.com
www.rejinpaul.com
pf3
pf4
pf5
pf8
pf9
pfa
pfd
pfe
pff
pf12
pf13
pf14
pf15
pf16
pf17
pf18
pf19
pf1a
pf1b
pf1c
pf1d
pf1e
pf1f
pf20
pf21
pf22
pf23
pf24
pf25
pf26
pf27
pf28
pf29
pf2a
pf2b
pf2c
pf2d
pf2e
pf2f
pf30
pf31
pf32
pf33
pf34
pf35
pf36
pf37
pf38
pf39
pf3a
pf3b
pf3c
pf3d
pf3e
pf3f
pf40
pf41
pf42
pf43
pf44
pf45
pf46
pf47
pf48
pf49
pf4a
pf4b
pf4c
pf4d
pf4e
pf4f
pf50
pf51
pf52
pf53
pf54
pf55
pf56
pf57
pf58
pf59
pf5a
pf5b
pf5c
pf5d
pf5e
pf5f
pf60
pf61
pf62
pf63
pf64

Partial preview of the text

Download Ise vii object oriented modeling and design [10cs71] notes and more Study notes Computer Science in PDF only on Docsity!

Object Oriented Modeling and Design 10CS

Dept. of ISE, SJBIT Page 1

OBJECT ORIENTED MODELING AND DESING

Subject Code: 10CS71 I.A. Marks : 25 Hours/Week : 04 Exam Hours: 03 Total Hours : 52 Exam Marks: 100 PART - A

UNIT - 1 7 Hours

INTRODUCTION, MODELING CONCEPTS, CLASS MODELING: What is Object Orientation? What is OO development? OO themes; Evidence for usefulness of OO development; OO modeling history. Modeling as Design Technique: Modeling; abstraction; The three models. Class Modeling: Object and class concepts; Link and associations concepts; Generalization and inheritance; A sample class model; Navigation of class models; Practical tips.

UNIT - 2 6 Hours

ADVANCED CLASS MODELING, STATE MODELING: Advanced object and class concepts; Association ends; N-ary associations; Aggregation; Abstract classes; Multiple inheritance; Metadata; Reification; Constraints; Derived data; Packages; Practical tips. State Modeling: Events, States, Transitions and Conditions; State diagrams; State diagram behavior; Practical tips.

UNIT - 3 6 Hours

ADVANCED STATE MODELING, INTERACTION MODELING: Advanced State Modeling: Nested state diagrams; Nested states; Signal generalization; Concurrency; A sample state model; Relation of class and state models; Practical tips. Interaction Modeling: Use case models; Sequence models; Activity models. Use case relationships; Procedural sequence models; Special constructs for activity models.

UNIT - 4 7 Hours

PROCESS OVERVIEW, SYSTEM CONCEPTION, DOMAIN ANALYSIS: Process Overview: Development stages; Development life cycle. System Conception: Devising a system concept; Elaborating a concept; Preparing a problem statement. Domain Analysis: Overview of analysis; Domain class model; Domain state model; Domain interaction model; Iterating the analysis.

PART - B

UNIT - 5 7 Hours

APPLICATION ANALYSIS, SYSTEM DESIGN: Application Analysis: Application interaction model; Application class model; Application state model; Adding operations. Overview of system design; Estimating performance; Making a reuse plan; Breaking a system in to sub-systems; Identifying concurrency; Allocation of sub-systems; Management of data storage; Handling global resources; Choosing a

Object Oriented Modeling and Design 10CS

Dept. of ISE, SJBIT Page 2

software control strategy; Handling boundary conditions; Setting the trade-off priorities; Common architectural styles; Architecture of the ATM system as the example.

UNIT - 6 7 Hours

CLASS DESIGN, IMPLEMENTATION MODELING, LEGACY SYSTEMS: Class Design: Overview of class design; Bridging the gap; Realizing use cases; Designing algorithms; Recursing downwards, Refactoring; Design optimization; Reification of behavior; Adjustment of inheritance; Organizing a class design; ATM example. Implementation Modeling: Overview of implementation; Fine-tuning classes; Fine-tuning generalizations; Realizing associations; Testing. Legacy Systems: Reverse engineering; Building the class models; Building the interaction model; Building the state model; Reverse engineering tips; Wrapping; Maintenance.

UNIT - 7 6 Hours

DESIGN PATTERNS – 1: What is a pattern and what makes a pattern? Pattern categories; Relationships between patterns; Pattern description.

Communication Patterns: Forwarder-Receiver; Client-Dispatcher-Server; Publisher- Subscriber.

UNIT - 8 6 Hours

DESIGN PATTERNS – 2, IDIOMS: Management Patterns: Command processor; View handler. Idioms: Introduction; What can idioms provide? Idioms and style; Where to find idioms; Counted Pointer example.

TEXT BOOKS:

Text Books:

  1. Michael Blaha, James Rumbaugh: Object-Oriented Modeling and Design with UML, 2nd^ Edition, Pearson Education, 2005. (Chapters 1 to 17, 23)
  2. Frank Buschmann, Regine Meunier, Hans Rohnert, Peter Sommerlad, Michael Stal: Pattern-Oriented Software Architecture, A System of Patterns, Volume 1, John Wiley and Sons, 2007. (Chapters 1, 3.5, 3.6, 4)

Reference Books:

  1. Grady Booch et al: Object-Oriented Analysis and Design with Applications, 3 rd Edition, Pearson Education, 2007.
  2. Brahma Dathan, Sarnath Ramnath: Object-Oriented Analysis, Design, and Implementation, Universities Press, 2009.
  3. Hans-Erik Eriksson, Magnus Penker, Brian Lyons, David Fado: UML 2 Toolkit, Wiley- Dreamtech India, 2004.
  4. Simon Bennett, Steve McRobb and Ray Farmer: Object-Oriented Systems Analysis and Design Using UML, 2nd^ Edition, Tata McGraw-Hill, 2002.

Object Oriented Modeling and Design 10CS

Dept. of ISE, SJBIT Page 4

Unit1: INTRODUCTION, MODELING CONCEPTS, CLASS

MODELING:

Syllabus ---7hr

  • What is object orientation?
  • What is oo development?
  • Oo themes
  • Evidence for usefulness of oo development
  • Oo modeling history
  • Modeling
  • Abstraction
  • The tree models
  • Objects and class concepts
  • Link and association concepts
  • Generalization and inheritance
  • A sample class model
  • Navigation of class models
  • Practical tips

INTRODUCTION

Note 1: Intention of this subject (object oriented modeling and design) is to learn how to apply object -oriented concepts to all the stages of the software development life cycle. Note 2: Object-oriented modeling and design is a 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. WHAT IS OBJECT ORIENTATION?  Definition: OO means that we organize software as a collection of discrete objects (that incorporate both data structure and behavior). There are four aspects (characteristics) required by an OO approacho Identity.  Classification.  Inheritance.  Polymorphism.  Identity:Identity means that data is quantized into discrete, distinguishable entities called objects.  E.g. for objects: personal computer, bicycle, queen in chess etc.

Object Oriented Modeling and Design 10CS

Dept. of ISE, SJBIT Page 5

 Objects can be concrete (such as a file in a file system) or conceptual (such as scheduling policy in a multiprocessing OS). Each object has its own inherent identity. (i.e two objects are distinct even if all their attribute values are identical).  In programming languages, an object is referenced by a unique handle.  Classification:Classification means that objects with the same data structure (attribute) and behavior (operations) are grouped into a class.  E.g. paragraph, monitor, chess piece.  Each object is said to be an instance of its class.  Fig below shows objects and classes: Each class describes a possibly infinite set of individual objects.

Inheritance:  It is the sharing of attributes and operations (features) among classes based on a hierarchical relationship. A super class has general information that sub classes refine and elaborate.  E.g. Scrolling window and fixed window are sub classes of window.  Polymorphism:Polymorphism means that the same operation may behave differently for different classes.  For E.g. move operation behaves differently for a pawn than for the queen in a chess game.

Object Oriented Modeling and Design 10CS

Dept. of ISE, SJBIT Page 7

  Domain Model - a description of real world objects reflected within the system.   Application Model - a description of parts of the application system itself that are visible to the user.  E.g. In case of stock broker application-  Domain objects may include- stock, bond, trade & commission.  Application objects might control the execution of trades and present the results.  System Design: The development teams devise a high-level strategy- The System Architecture- for solving the application problem. The system designer should decide what performance characteristics to optimize, chose a strategy of attacking the problem, and make tentative resource allocations.  Class Design: The class designer adds details to the analysis model in accordance with the system design strategy. His focus is the data structures and algorithms needed to implement each class.  Implementation: Implementers translate the classes and relationships developed during class design into a particular programming language, database or hardware. During implementation, it is important to follow good software engineering practice. Three models We use three kinds of models to describe a system from different view points.

  1. Class Model— for the objects in the system & their relationships. It describes the static structure of the objects in the system and their relationships. Class model contains class diagrams- a graph whose nodes are classes and arcs are relationships among the classes.
  2. State model— for the life history of objects. It describes the aspects of an object that change over time. It specifies and implements control with state diagrams-a graph whose nodes are states and whose arcs are transition between states caused by events.
  3. Interaction Model —for the interaction among objects. It describes how the objects in the system co-operate to achieve broader results. This model starts with use cases that are then elaborated with sequence and activity diagrams. Use case – focuses on functionality of a system – i.e what a system does for users. Sequence diagrams – shows the object that interact and the time sequence of their interactions. Activity diagrams – elaborates important processing steps.

OO THEMES

Object Oriented Modeling and Design 10CS

Dept. of ISE, SJBIT Page 8

Several themes pervade OO technology. Few are –

  1. Abstraction  Abstraction lets you focus on essential aspects of an application while ignoring details i.e focusing on what an object is and does, before deciding how to implement it.  It’s the most important skill required for OO development.
    1. Encapsulation (information hiding)  It separates the external aspects of an object (that are accessible to other objects) from the internal implementation details (that are hidden from other objects)  Encapsulation prevents portions of a program from becoming so interdependent that a small change has massive ripple effects.
    2. Combining data and behavior  Caller of an operation need not consider how many implementations exist.  In OO system the data structure hierarchy matches the operation inheritance  hierarchy (fig). 4. Sharing  OO techniques provide sharing at different levels.  Inheritance of both data structure and behavior lets sub classes share common code.  OO development not only lets you share information within an application, but also offers the prospect of reusing designs and code on future projects.
    3. Emphasis on the essence of an object  OO development places a greater emphasis on data structure and a lesser emphasis on procedure structure than functional-decomposition methodologies.
    4. Synergy  Identity, classification, polymorphism and inheritance characterize OO languages.

Object Oriented Modeling and Design 10CS

Dept. of ISE, SJBIT Page 10

 Actions and events in a state diagram become operations on objects in the class model. References between state diagrams become interactions in the interaction model.

  1. Interaction model – represents the collaboration of individual objects, the “interaction” aspects of a system.  Interaction model describes interactions between objects – how individual objects collaborate to achieve the behavior of the system as a whole.  The state and interaction models describe different aspects of behavior, and you need both to describe behavior fully.  Use cases, sequence diagrams and activity diagrams document the interaction model. CLASS MODELLING Note: A class model captures the static structure of a system by characterizing the objects in the system, the relationships between the objects, and the attributes and operations for each class of objects. OBJECT AND CLASS CONCEPT Objects Purpose of class modeling is to describe objects. An object is a concept, abstraction or thing with identity that has meaning for an application. Ex: Joe Smith, Infosys Company, process number 7648 and top window are objects. Classes An object is an instance or occurrence of a class. A class describes a group of objects with the same properties (attributes), behavior (operations), kinds of relationships and semantics. Ex: Person, company, process and window are classes. Note: All objects have identity and are distinguishable. Two apples with same color, shape and texture are still individual apples: a person can eat one and then the other. The term identity means that the objects are distinguished by their inherent existence and not by descriptive properties that they may have.

Object Oriented Modeling and Design 10CS

Dept. of ISE, SJBIT Page 11

CLASS MODELLING

  • OBJECT AND CLASS CONCEPT
  • An (^) objectobject has three characteristics: (^) statestate , behaviorbehavior and a unique identificationa unique identification. or
  • An object is a concept, abstraction or thing

with identity that has meaning for an

application. Eg:

  • Note: The term identity means that the objects are distinguished by their inherent existence and not by descriptive properties that they may have.

Class diagrams  Class diagrams provide a graphic notation for modeling classes and their relationships, thereby describing possible objects. Note: An object diagram shows individual objects and their relationships. Useful for documenting test cases and discussing examples. Class diagrams are useful both for abstract modeling and for designing actual programs. Note: A class diagram corresponds to infinite set of object diagrams. Figure below shows a class (left) and instances (right) described by it.

 Conventions used (UML):  UML symbol for both classes and objects is box.  Objects are modeled using box with object name followed by colon followed by class name.  Use boldface to list class name, center the name in the box and capitalize the first letter. Use singular nouns for names of classes.  To run together multiword names (such as JoeSmith), separate the words with  intervening capital letter. Values and Attributes:  Value is a piece of data.

Object Oriented Modeling and Design 10CS

Dept. of ISE, SJBIT Page 13

 UML conventions used –  List operations in 3rd compartment of class box.  List operation name in regular face, left align and use lower case for first letter.  Optional details like argument list and return type may follow each operation name.  Parenthesis enclose an argument list, commas separate the arguments. A colon precedes the result type.  Note: We do not list operations for objects, because they do not vary among objects of same class. Summary of Notation for classes

Fig: Summary of modeling notation for classes

Fig: Notation for an argument of an operation

Object Oriented Modeling and Design 10CS

Dept. of ISE, SJBIT Page 14

Class Digarms: Relationships

  • Classes can related to each other through different relationships: - Dependency - Association (delegation) - Generalization (inheritance) - Realization (interfaces)

Class1 Class

Class1 Class

Base (^) sub

Base (^) sub

  1. Dependency: A Uses Relationship
  • Dependencies
    • occurs when one object depends on another
    • if you change one object's interface, you need to change the dependent object
    • arrow points from dependent to needed objects

Jukebox CardReader CDCollection

SongSelector

Object Oriented Modeling and Design 10CS

Dept. of ISE, SJBIT Page 16

 Association name is optional, if the model is unambiguous. Ambiguity arises when a model has multiple associations among same classes.  Developers often implement associations in programming languages as references from one object to another. A reference is an attribute in one object that refers to another object.

Object Oriented Modeling and Design 10CS

Dept. of ISE, SJBIT Page 17

Multiplicity  Multiplicity specifies the number of instances of one class that may relate to a single instance of an associated class. Multiplicity constrains the number of related objects.  UML conventions:  UML diagrams explicitly lists multiplicity at the ends of association lines.  UML specifies multiplicity with an interval, such as “1” (exactly one). “1..”(one or more). “3..5”(three to five, inclusive). “ * ” ( many, i.e zero or more).

  • notations

Class

Class

Class

Class

1

0..*

0..

m..n

exactly one many (zero or more) optional (zero or one) numerically Specified (m to n, inclucive)

Course CourseOffering 1

0..*

Example:

Object Oriented Modeling and Design 10CS

Dept. of ISE, SJBIT Page 19

Multiplicity of Associations

• Many-to-one

  • Bank has many ATMs, ATM knows only 1 bank

• One-to-many

  • Inventory has many items, items know 1 inventory

Object Oriented Modeling and Design 10CS

Dept. of ISE, SJBIT Page 20

Association - Multiplicity

  • A teacher teaches 1 to 3 courses (subjects)
  • Each course is taught by only one teacher.
  • A student can take between 1 to 5 courses.
  • A course can have 10 to 300 students.

Association – Multiplicity

Teacher Course

(^1) Teaches (^) 1..

Students

Takes

1..

10..