MCS-032 Object Oriented Analysis & Design

  • View
    31

  • Download
    3

Embed Size (px)

DESCRIPTION

MCS-032 Object Oriented Analysis & Design. Block -1 Object Oriented Modeling and UML. Object Orientation. What Is Object Orientation Advantages of Object Orientation Elements of Object Model What is UML Goals Of UML Systems Phases In System Development. 3. - PowerPoint PPT Presentation

Text of MCS-032 Object Oriented Analysis & Design

Slide 1MCS-032
Block -1
© Copyright PCTI Group 2009
*
Object Orientation
Object orientation is a method for organizing systems as collections of interacting objects that combine data as well as behavior.
© Copyright PCTI Group 2009
Object Orientation
When models are constructed using object orientation in a proper way, they become easy to communicate, change, expand and validate.
© Copyright PCTI Group 2009
Object Orientation
The object oriented paradigm focuses on real world concepts rather than realization constructs.
© Copyright PCTI Group 2009
*
*
Decomposition into a set of cohesive and loosely coupled modules.
Hierarchy
© Copyright PCTI Group 2009
*
Generalization, inheritance & reuse are important issues
Imported into CommonKADS domain- schema notation
no use made of operation box
*
*
*
Abbreviation: "class"
it provides a means for abstraction
*
*
Attributes
An attribute describes a value held by objects belonging to the class.
Attribute specification consists of:
Attribute name (name)
Admissible values (string)
Optional: default value
*
objects of a class".
Method: implementation of an operation
functional view
*
*
Majority of associations:
Ternary associations come up occasionally.
Associations between more than three objects are rare.
*
© Copyright PCTI Group 2009
*
*
*
Typical types of multiplicity:
1 Precisely one.
*
Association class
Modeling an association as a class if the association has an internal information structure
Advantage: associations become first-class objects.
*
*
*
Associations provide a general, "neutral", way of connecting object classes.
Semantics of the association are defined through argument typing, multiplicity and (implicitly) the name of the association.
Class diagrams provide specific types of associations, with predefined semantics:
generalization ("is a").
aggregation ("part of").
*
Purpose: sharing similarities while preserving differences
Is an association between a class that acts as super-class and one or more classes called the sub-classes.
*
*
*
Aggregation
Aggregation denotes a binary association in which one side is an "assembly" and the other side a "part".
"Assembly" and "part" act as predefined roles involved in the aggregation association.
Cardinality of a part can be defined
precisely one; optional (0-1); many, ...
*
*
*
*
*
instance tree (aggregation) vs. class tree (generalization)
*
*
*
provides outsider view (customer)
used in early phases of system analysis
*
*
*
*
*
*
Define Analysis
Analysis is a detailed study of the various operations performed by a system and their relationships within and outside of the system.
© Copyright PCTI Group 2009
*
Define Analysis
During analysis data are collected on the available files, decision points, and transactions handled by the present system
© Copyright PCTI Group 2009
*
© Copyright PCTI Group 2009
*
Once the Analysis is completed the analyst has a firm understanding of what is to done. The next step is to decide how the problem might be solved. Thus, in systems design, we move from the logical to the physical aspects of the life cycle.
© Copyright PCTI Group 2009
Design
Design refers to the technical specifications that will be applied in implementing the candidate system. This involves input/output, file, and processing design Refers to the technical specifications that will be applied in implementing the candidate system. This involves input/output, file, and processing design
© Copyright PCTI Group 2009
*
Why OOAD
Object Oriented approach to software development based on modeling objects from the real world & then using the model to build a language independent design organized around those objects.
© Copyright PCTI Group 2009
© Copyright PCTI Group 2009
*
Report published in JAPAN
The software industry still relies mainly on the informal paper and pencil approach in the upstream development phases.
© Copyright PCTI Group 2009
Why to use MODELS
The process of problem-solving using a computer is an intricate process requiring much thought, careful planning, logical precision, persistence, and attention to detail.
© Copyright PCTI Group 2009
Procedural Model
Each problem is divided into smaller problem and solved using specified modules that act on data.
© Copyright PCTI Group 2009
*
This approach to software development is process centric or procedural
Not ideal for developing complex software coz, concentrates on the processes
© Copyright PCTI Group 2009
*
Procedural Model
Modules are tightly interwoven and interdependent, that it is difficult to separate one module from another
Reusability of software becomes difficult as complexity increases with processes
© Copyright PCTI Group 2009
Object Oriented Model
It perceives the entire software system as a collection of objects which contain attributes and behaviors
© Copyright PCTI Group 2009
*
*
Component Based Model
Software development is done based on a standard that allows software components to communicate with one another.
© Copyright PCTI Group 2009
*
Component Based Model
A reusable software that can be easily plugged in or unplugged from an application.
© Copyright PCTI Group 2009
*
Object Oriented Methodology
Consists of building a model of an application domain and then adding implementation details to it during the design of a system.
This approach is called Object Modeling Technique
© Copyright PCTI Group 2009
*
*
*
Describes the static structure of the objects in a system–
Their identity
Their attributes
Their operations
*
Dynamic Model
Describes those aspects of a system concerned with time and the sequencing of operations—
events that mark changes
the organization of events and states
© Copyright PCTI Group 2009
*
Dynamic Model
Describes those aspects of a system concerned with time and the sequencing of operations—
events that mark changes
the organization of events and states
© Copyright PCTI Group 2009
*
the sequence of operations that occur
without regard for what the operations do, what they operate on
how they are implemented
© Copyright PCTI Group 2009
*
Functional Model
Describes those aspects of a system concerned with transformations of values—
Functions
Mappings
Constraints
*
specifying
Visualizing
documenting
© Copyright PCTI Group 2009
*
Modeling is the designing of software applications before coding.
Modeling is an Essential Part of large software projects, and helpful to medium and even small projects as well.
© Copyright PCTI Group 2009
*
What is Modeling
A model plays the analogous role in software development that blueprints and other plans (site maps, elevations, physical models) play in the building of a skyscraper.
© Copyright PCTI Group 2009
*
What is Modeling
Using a model, those responsible for a software development project's success can assure themselves that business functionality is complete and correct
© Copyright PCTI Group 2009
*
© Copyright PCTI Group 2009
*
The UML
Helps to specify, visualize, and document models of software systems, including their structure and design, in a way that meets all of these requirements.
Can be used UML for business modeling and modeling of other non-software systems too.
© Copyright PCTI Group 2009
*
The UML
Using any one of the large number of UML based tools, one can analyze future application's requirements and design a solution that meets them, representing the results using UML’s twelve standard diagram types
© Copyright PCTI Group 2009
*
Four diagram types represent static application structure
Five represent different aspects of dynamic behavior
Three represent ways you can organize and manage your application modules. 
© Copyright PCTI Group 2009
*
Structural Diagrams include:
*
*
*
*
*
What is UML. Explain.
What are systems. Give the various types.
Describe the phases of system Development
© Copyright PCTI Group 2009
*
A system is described with a number of different aspects:
Functional
Non-Functional
*
Views
The system is described in a number of views, where each view represents a projection of the complete system description
© Copyright PCTI Group 2009
*
Use-case View
Models the functionality as perceived by the external users known as actors.
Lists the actors and use- cases, and show which actor participates in each use-case.
© Copyright PCTI Group 2009
*
*
© Copyright PCTI Group 2009
*
Is for designers and developers
Describes both the static structure and the dynamic collaborations that occur when the message is send to each other to provide a given function.
© Copyright PCTI Group 2009
*
State diagrams
Sequence diagrams
Collaboration diagrams
Activity diagrams
*
Logical View
Logical view is also known as Structural Model View or Static View
© Copyright PCTI Group 2009
*
Composed of component diagram
© Copyright PCTI Group 2009
*
© Copyright PCTI Group 2009
*
Is for developers and integrators
Deals with the division of the system into processes and processors.
© Copyright PCTI Group 2009
*
*
© Copyright PCTI Group 2009
*
Represented by the deployment diagram
© Copyright PCTI Group 2009
*
the computers
© Copyright PCTI Group 2009
*
Deployment View
Permits the consequences of distribution and resource allocation to be assessed.
© Copyright PCTI Group 2009
*
*
Use Case Diagrams
Describes the functionality of a system and users of the system.
Contains:
Actors
Use-cases
*
Use Case Diagrams
Actors represent the users of the system, human users and other systems
© Copyright PCTI Group 2009
*
*
Shows the static structure of classes in the system.
Is a schema, pattern,or template for describing many possible instances of data
Describes object classes
*
Associations representing relationships that relate 2 or more classes
© Copyright PCTI Group 2009
*
Class Diagram
Classes Can be related to each other in number of ways:
Associated classes(connected to each other)
Dependent classes(one class depends/uses another class)
© Copyright PCTI Group 2009
*
Packaged classes(grouped together as a unit)
Class Diagram
*
*
Describes particular situation
© Copyright PCTI Group 2009
*
Links representing the particular relationships between objects which are instances of associations
© Copyright PCTI Group 2009
*
*
*
State Diagram
Describes the behavior of a class in response to an external stimuli
Describes the life cycle of object
It relates events and states
© Copyright PCTI Group 2009
*
Contains:
States representing the situations during the life cycle of an object in which it satisfies some condition, performs some activity or waits for some occurrence
© Copyright PCTI Group 2009
*
Transitions representing relationships between the different states of an object
© Copyright PCTI Group 2009
*
State Diagram
Are not drawn for all the classes, only for those that have a number of well defined states and where the behavior of the class is affected and changed by different states.
© Copyright PCTI Group 2009
*
*
Describe the interactions among classes
Focuses on classes and the messages they exchange to accomplish some behavior
© Copyright PCTI Group 2009
*
Contain:
class roles representing roles that objects may play within the interaction
lifelines representing the existence of an object over a period of time
© Copyright PCTI Group 2009
*
Sequence Diagram
activations representing the time which as object is performing an operation
Messages representing communication between object, active object
© Copyright PCTI Group 2009
*
*
*
Describes the interactions among classes and associations.
These interactions are modeled as exchanges of messages between classes through their associations.
© Copyright PCTI Group 2009
*
Contain the elements:
Class roles representing roles that objects may play within the interaction
Association roles representing roles that links may play within the interaction
© Copyright PCTI Group 2009
*
Collaboration Diagram
Message flows representing the messages sent between the objects via links.
© Copyright PCTI Group 2009
*
*
sequential flow of activities.
the behavior of a class in response to internal processing rather than external events.
© Copyright PCTI Group 2009
*
Contains the following elements:
swimlanes representing the responsibility of one or more objects for actions with in an overall activity
© Copyright PCTI Group 2009
*
Action states representing actions of entities or steps in the execution process
action flows representing relationships between the different action states of an entity
© Copyright PCTI Group 2009
*
Activity Diagram
Object flows representing the utilization of objects by action states and the influence of action states on objects
© Copyright PCTI Group 2009
*
Show MessageBox “Printing” on screen
Remove MesageBox
*
Describes the organization of and dependencies among the software implementation components
© Copyright PCTI Group 2009
*
Source code component
Object code component
Executable code component
*
*
the environmental view of the system
The physical architecture of the hardware and software in the system.
© Copyright PCTI Group 2009
*
and their relationships
Different views of the system are are used to give a coherent description of the system as a whole.
© Copyright PCTI Group 2009
*
*
*
*
*
Association: Connects elements and links instances.
Generalizations: It means that an element can be a specialization of another element. Also called inheritance.
© Copyright PCTI Group 2009
*
Model Elements
Dependency: Shows that one element depends in some way or another element
Aggregation: A form of association in which an element contains other elements.
© Copyright PCTI Group 2009
*
*
*
Role
Is a name that uniquely identifies one end of an association
Provides a way of traversing associations from an object at one end, without explicitly mentioning the association.
© Copyright PCTI Group 2009
*
*
The ordering is an inherent part of the association.
An ordered set of objects on the “many” end of an association is indicated by writing “{ordered}” next to the multiplicity dot for the role.
© Copyright PCTI Group 2009
*
Window
Screen
{ordered}
Visible-on
*
A qualified association relates two object classes and a qualifier.
The qualifier is a special attribute that reduces the effective multiplicity of an association.
© Copyright PCTI Group 2009
*
*
*
*
*
Unified Modeling Language: proposal for set of standard notations
wide attention
see www.rational.com
*
*
State diagram
*
Model control and information flow of a procedure or process
Useful if control is mainly synchronous
otherwise: use state diagram
worksheet OM-2 of the organization model
*
*
activity, task
difference with state diagrams
After termination the action state can lead to another action state
“state transition”
*
*
*
*
Sate transition is deterministic
*
*
*
Swim lanes
Process can sometimes be distributed over several agents or organizational units
Notation: use compartments
*
*
*
*
*
*
*
*
Use if control is heavily influenced by “external” events
Draw a state diagram for object classes with interesting behavior
Activity diagram is alternative
*
*
Message: generates event for another object
Guard: outcome of internal object computation
*
*
on event
*
*
*
*
State Generalization
If Object A is in super-state S, then the object us in precisely one of the sub-states
Cf. concurrency: “and”-states
*
Overlap with activity diagrams
*
*
*
Generalization, inheritance & reuse are important issues
Imported into CommonKADS domain- schema notation
no use made of operation box
*
*
*
Abbreviation: "class"
it provides a means for abstraction
*
*
Attributes
An attribute describes a value held by objects belonging to the class.
Attribute specification consists of:
Attribute name (name)
Admissible values (string)
Optional: default value
*
it "lives” only in connection to a certain object.
RULE 1: an object is not allowed as a possible value of an attribute!
*
*
Values and Value Sets
Values are the primitive things with no internal structure from the viewpoint of the application
Admissible values are defined through a value set
Typical predefined value-sets:
User-defined:
*
*
Object Identifiers
In O-O modeling you assume that every object has an identity.
Consequence: introduce only attributes that act as identifiers, iff the identifier is something that exists in the real world.
Examples: student card number, social security number.
*
*
Operations
Definition:
operation is "a function or a transformation that can be applied to objects of a class".
Objects in a class share the same operations.
Method: implementation of an operation
= functional view
*
*
Majority of associations:
Ternary associations come up occasionally.
Associations between more than three objects are rare.
*
© Copyright PCTI Group 2009
*
*
*
Typical types of multiplicity:
1 Precisely one.
*
Association class
Modeling an association as a class if the association has an internal information structure
Advantage: associations become first-class objects.
*
*
*
*
*
Associations provide a general, "neutral", way of connecting object classes.
Semantics of the association are defined through argument typing, multiplicity and (implicitly) the name of the association.
Class diagrams provide specific types of associations, with predefined semantics:
generalization ("is a").
aggregation ("part of").
*
Purpose: sharing similarities while preserving differences
Is an association between a class that acts as super-class and one or more classes called the sub-classes.
*
*
*
Aggregation
Aggregation denotes a binary association in which one side is an "assembly" and the other side a "part".
"Assembly" and "part" act as predefined roles involved in the aggregation association.
Cardinality of a part can be defined
precisely one; optional (0-1); many, ...
*
*
*
*
*
instance tree (aggregation) vs. class tree (generalization)
*
*
*
provides outsider view (customer)
used in early phases of system analysis
*
*
*
*
Required services:
STUDENT: update personal data, inspect exam results, inspect course info, enroll in course
TUTOR: inspect exam results, update course info, inspect enrollments
*
*
*
*
*
*
*
Dynamic Model
Describes those aspects of a system concerned with time, changes and the sequencing of operations—
events that mark changes
the organization of events and states
© Copyright PCTI Group 2009
*
the sequence of operations that occur
without regard for what the operations do, what they operate on
how they are implemented
© Copyright PCTI Group 2009
*
Dynamic Model
An object model describes the possible patterns of objects, attributes, and links that can exist in a system.
Over time, the objects stimulate each other, resulting in a series of changes to their states. An individual stimulus from one object to another is an event.
The pattern of events, states, and state transitions for a given class can be represented as a state diagram.
© Copyright PCTI Group 2009
*
Event
An event is something that happens at a point of time, such as user depressed left button or Flight 123 departs from Chicago.
An event has no duration.
One event may logically precede or follow another, or the two event may be unrelated.
An event is a one-way transmission of information from one objects to another. It is not like a subroutine call that returns a value.
© Copyright PCTI Group 2009
*
Scenarios and Event Trace
A scenario is a sequence of events that occurs during one particular execution of a system.
© Copyright PCTI Group 2009
*
called party answers
phones are connected
*
Scenarios and Event Traces
The next steps after writing a scenario is to identify the sender and receiver objects of each event.
The sequence of events and the objects exchanging events can both be shown in an augmented scenario called an event trace diagram.
This diagram shows each object as a vertical line and each event as a horizontal arrow from the sender object to the receiver object.
© Copyright PCTI Group 2009
*
*
States
A State is an abstraction of the attribute values and links of an object in other words you can say that the attribute values and links held by an object are called its state.
A State corresponds to the interval between two events received by an object. Events represent point in time , states represent intervals of time. For example, after the receiver is lifted and before the first digit is dialed, the phone line is in state Dial tone.
© Copyright PCTI Group 2009
A State has duration. It occupies an interval of time. A State is…