Object oriented modeling and design

65
Object oriented modeling and design JAYA KOLEKAR

Transcript of Object oriented modeling and design

Object oriented modeling and design

Object oriented modeling and designJAYA KOLEKAR

IntroductionObject:Real world entities.Heart of object oriented approachObject orientation:Viewing and modeling the world or system as a set of interacting & interrelated objects.Object oriented modeling:Focuses on the designing of object oriented systems.Model:It can be defined as an abstraction of something before it is actually developed ,installed or put into practice.A model is an abstraction of something for the purpose of understanding it before building it.

2/7/20172jaya kolekar

IntroductionOOA(Object Oriented Analysis):It is discovery and documentation of the key problem domain classes which are related with developing and OOM of the problem domain.Benefits of OOAMaintainabilityReusabilityProductivityOOD(Object Oriented Design):It is concerned with developing OOM of s/w to implement the requirement identified by OOA2/7/20173jaya kolekar

OO ThemesAbstraction:It represents behavior of real world entity.Manages complexity by concentrating on essential or important aspects making an entity different from othersEncapsulation:Wrapping of dataSeparates implementation from users or clientsModularity(combining data & behavior):Break up complex systems into small, self contained and easily understandable pieces.Binding data together & hiding them outside world.2/7/20174jaya kolekar

OO ThemesSharingInheritance.Common structure to be shared among several similar subclasses without redundancy.SynergyIdentity, classification, polymorphism and inheritance characterize OO language & use all together.2/7/20175jaya kolekar

Importance of modelingModels help us to visualize the system as it is or as we want it to be.Models permit us to specify the structure or behavior or a system.Model gives us a template that guides us in constructing a system.Models document the decision we have made.2/7/20176jaya kolekar

Four principles of modelingThe choice of what models to create has a profound influence on how a problem is attacked & how a solution is shaped.Every model may be expressed at different levels of precision.The best models are connected to realityNo single model is sufficient .Every2/7/20177jaya kolekar

Object oriented methodologyRumbaughGrady BoochJacobson2/7/20178jaya kolekar

RUMBAUGH ETALS OBJECT MODELING TECHNIQUEDeveloped in 1991Describes a method for the analysis, design and implementation of a system using an object-oriented techniques.OMT is a fast , intuitive approach for identifying & modeling all the objects making up a systemShows dynamic behavior of objects within system

2/7/20179jaya kolekar

RUMBAUGH ETALS OBJECT MODELING TECHNIQUEOMT consists of 4 phases, which can be performed iterativelyAnalysis: analyst builds a model of the real-world situation showing its important properties

System design: target system is organized into subsystems based on analysis structure & proposed architecture

Object design: focus of the object design is the data structures & algorithms needed to implement each class

Implementation: object classes & relationships developed during object design finally translated into programming language, database or h/w implementation.

2/7/201710jaya kolekar

RUMBAUGH ETALS OBJECT MODELING TECHNIQUEOMT consists of 3 model:An Object model:Describes the structure of objects in a systemrepresented graphically with an object diagramObject diagram containsClassAttributeOperationInheritance2/7/201711jaya kolekar

RUMBAUGH ETALS OBJECT MODELING TECHNIQUEAn Object model: bank system

Client

FirstnamelastnameAccountNumberBalance

DepositwithDrawCreate TransactionTransaction

transDateAmountpostBalanceSaving Account

Checking AccountwithDraw

Checking SavingAccountClient AccountclassesSpecializationAccount TransactionAssociation2/7/201712jaya kolekar

RUMBAUGH ETALS OBJECT MODELING TECHNIQUEOMT consists of 3 model:Dynamic model:Depicts the dynamic aspects of the systemPortrays the changes occurring in the states of various objects with the eventsIt is represented using a state transition diagramState diagram containsStateSub/superstateEventActionActivity 2/7/201713jaya kolekar

RUMBAUGH ETALS OBJECT MODELING TECHNIQUEDynamic model: bank system

Nothing is selectedSelected checking or saving accountSelect transaction type (withdrawal, deposit)confirmationEnter the amountSelect checking accountAccount has been selected

Initial stateEventStatesTransitionAction

2/7/201714jaya kolekar

RUMBAUGH ETALS OBJECT MODELING TECHNIQUEOMT consists of 3 model:Functional model:Describes the data transformations of the systemDescribes the flow of data & changes that occur to the data throughout the systemDescribed using DFD(Data Flow Diagram)DFD containsProcessData storeDataflowExternal entity

2/7/201715jaya kolekar

RUMBAUGH ETALS OBJECT MODELING TECHNIQUEFunctional model:

ATM card readerUserUser keyboard entryUser screen selectionSelect bankSelect cardVerify pwdSelect accountUpdate accountCarsatiumAccountBank codeprocesspasswordAccount typeDataflowAmount, transaction typeBank databaseBad Bank codeInvalid card codeCard authBad pwdBad accountbalanceCash receiptTransaction failedExternal entityCard codeATM SYSTEM2/7/201716jaya kolekar

Conceptual model of UMLAs UML, describes the real time systems it is very important to make a conceptual model & then process gradually .Conceptual model of UML can be mastered by learning the following three major elementsUML building blocksRules Common mechanisms

2/7/201717jaya kolekar

Conceptual model of UMLBuilding BlocksThe vocabulary of the UML encompasses three kinds of building blocksThingsBasic element of UMLRelationshipsTies the things togetherDiagramsgroup interesting collections of things.

2/7/201718jaya kolekar

Conceptual model of UMLThings in UMLBasic elements in a model in Object Orientedthe abstractions that are first-class citizens in a modelUse them to write well formed modelsThings can beStructural ThingsBehavioral ThingsGrouping ThingsAnnotational Things2/7/201719jaya kolekar

Conceptual model of UMLStructural Thingsnouns of UML modelsRepresents physical or conceptual elementsStatic part of the modelList of structural thingsClassActive classInterfaceCollaborationUse caseComponentNodeartifacts

2/7/201720jaya kolekar

Conceptual model of UMLClassIt is a description of a set of objects that share the same attributes, operations, relationships, and semantics.It implements one or more interfacesGraphically, a class is rendered as a rectangle, including its name, attributes, and operations.Notation and example of class window

Class name

Attributes

operations2/7/201721jaya kolekar

Conceptual model of UMLActive ClassIts object own one or more processes or threads which initiate control activity.Graphically, an active class is rendered as a class with double lines on the left and rightNotation and example of active class EventManager Class name

Attributes

operations

2/7/201722jaya kolekar

Conceptual model of UMLInterfaceIt is a collection of operations that specify a service of a class or componentAn interface might represent the complete behavior of a class or component or only a part of that behavior.Graphically, an interface rendered as class with the keyword interface above the name or circle.Notation and example of interface IWindow

Name

Attributes

operationsProvidedRequired2/7/201723jaya kolekar

Conceptual model of UMLCollaborationdefines an interaction and is a society of roles and other elements that work together to provide some cooperative behavior that's bigger than the sum of all the elements. represent the implementation of patterns that make up a system. Graphically, a collaboration is rendered as an ellipse with dashed lines with its name.Notation and example of Collaboration chain or responsibility Collaboration

2/7/201724jaya kolekar

Conceptual model of UMLUse caseRepresents a set of actions performed by a system for a specific goalA use case is realized by a collaborationGraphically, a use case is rendered as an ellipse with solid lines, including only its nameNotation & example of use case Place order

Use case2/7/201725jaya kolekar

Conceptual model of UMLComponentDescribes physical part of a system.It is a modular part of the system design that hides its implementation behind a set of external interfaces. Within a system, components sharing the same interfaces can be substituted while preserving the same logical behavior Graphically, a component is rendered like a class with a special icon in the upper right corner( two tabs) Notation & example of component Abc

Component name

Abc.java

2/7/201726jaya kolekar

Conceptual model of UMLNodeIt is a physical element that exists at run time and represents a computational resource, generally having at least some memory and, often, processing capability. A set of components may reside on a node and may also migrate from node to node. Graphically, a node is rendered as a cube, including only its name Notation & example of node servernode2/7/201727jaya kolekar

Conceptual model of UMLArtifactIt is a physical and replaceable part of a system that contains physical information ("bits"). artifacts are source code files, executables, and scripts.An artifact typically represents the physical packaging of source or run-time information.Graphically, an artifact is rendered as a rectangle with the keyword artifact above the name Notation & example of artifact

name2/7/201728jaya kolekar

Conceptual model of UMLBehavioral ThingsThe dynamic parts of UML modelsThese are the verbs of a model, representing behavior over time and space.List of Behavioral ThingsInteractionState MachineActivity

2/7/201729jaya kolekar

Conceptual model of UMLInteractionIt is a behavior that comprises a set of messages exchanged among a set of objects or roles within a particular context to accomplish a specific purpose. An interaction involves a number of other elements, including messages, actions, and connectors .Graphically, a message is rendered as a directed line, with the name of its operation.Example

Message name2/7/201730jaya kolekar

Conceptual model of UMLState MachineIt is a behavior that specifies the sequences of states an object or an interaction goes through during its lifetime in response to events.The behavior of an individual class or a collaboration of classes may be specified with a state machine.A state machine involves a number of other elements, including states, transitions, events, and activitiesGraphically, a state is rendered as a rounded rectangle, including its name and its substates, if any.Example

State name2/7/201731jaya kolekar

Conceptual model of UMLActivityIt is a behavior that specifies the sequence of steps a computational process performs.The focus is on the flows among steps without regard to which object performs each step.A step of an activity is called anaction.Graphically, an activity is rendered as a rounded rectangle with a name indicating its purpose.Example

Activity name2/7/201732jaya kolekar

Conceptual model of UMLGrouping ThingsThe organizational parts of UML .Boxes into which a model can be decomposed.List of Grouping ThingPackage

2/7/201733jaya kolekar

Conceptual model of UMLPackageIt is the only one grouping thing available for gathering structural & behavioral things. It exists only at development time.Graphically, a package is rendered as a tabbed folder, including only its name and, sometimes, its contents.Example

Package name

2/7/201734jaya kolekar

Conceptual model of UMLAnnotational ThingsThe explanatory parts of UML models.Used to describe, illuminate, and remark about any element in a model. There is one primary kind of annotational thing, called a note.

2/7/201735jaya kolekar

Conceptual model of UMLNoteIt is used to render comments, constraints etc of an UML element.Graphically, a note is rendered as a rectangle with a dog-eared corner, together with a textual or graphical comment.Example

2/7/201736jaya kolekar

Conceptual model of UMLRelationshipIt shows how elements are associated with each other.Describes the functionality of an application.Types of relationshipsDependencyAssociationGeneralizationRealizationAggregationCompositionMultiplicity

2/7/201737jaya kolekar

Conceptual model of UMLDependency It is a semantic relationship between two model elements in which a change to one (independent) may affect the semantics of the other (dependent) element .Graphically, a dependency is rendered as a dashed line, possibly directed, and including a label.Example

Independent classDependent classPerson

Has read(book)Book2/7/201738jaya kolekar

Conceptual model of UMLAssociation It is a structural relationship among classes that describes a set of links. A link being a connection among objects that are instances of the classes. Graphically, an association is rendered as a solid line, including a label, adornments, such as multiplicity and end names Example

Class1Class2Person

CompanyAssociation name Works forEmployee employer * 1 2/7/201739jaya kolekar

Conceptual model of UMLGeneralization It a specialization/generalization relationship in which the specialized element (child) builds on the specification of the generalized element (parent). Graphically, a generalization relationship is rendered as a solid line with a hollow arrowhead pointing to the parent. Example

child2child1parent

SavingCurrentAccount

2/7/201740jaya kolekar

Conceptual model of UMLrealization It is a semantic relationship between classifiers, wherein one classifier specifies a contract that another classifier guarantees to carry out.It is rendered as a cross between a generalization & dependency relationship.Graphically, a realization relationship is rendered as a cross between a generalization and a dependency relationship Example

classifier2classifier1

PrinterPrinter setup

2/7/201741jaya kolekar

Conceptual model of UMLaggregation Aggregation is a special kind of association, representing a structural relationship between a whole and its parts.The contained classes are not strongly dependent on the life cycle of the container.Graphically , aggregation rendered as a line from the parent class to child class with diamond shape near parent classExample

ParentChild

CollegeDepartment

2/7/201742jaya kolekar

Conceptual model of UMLcomposition very similar to aggregation relationship.The contained class will be obliterated when the container class destroyedGraphically, a composition is rendered as a solid line, with filled diamond shape, and including a label.Example

ParentChild

LibraryBooks

2/7/201743jaya kolekar

Conceptual model of UMLMultiplicity It is the active logical association when the cardinality of a class in relation to another is being depicted.It is also called as cardinality.Example

Personcompany1..* works for 12/7/201744jaya kolekar

Conceptual model of UMLDiagramsIt is the graphical presentation of a set of elements.Rendered as a connected graph of vertices (things) and paths (relationships). In theory, a diagram may contain any combination of things and relationships.Used to visualize a system from different perspectives.Three classification of UML diagramBehavior DiagramsInteraction DiagramsStructure Diagrams2/7/201745jaya kolekar

Conceptual model of UMLDiagramStructure Diagram Behavior DiagramClassDiagramComponent DiagramPackageDiagramDeployment DiagramComposite structureDiagram Object DiagramActivity DiagramUse case DiagramState Machine DiagramSequence DiagramInteraction Overview DiagramCommunication DiagramTimingDiagramInteraction Diagram

2/7/201746jaya kolekar

Conceptual model of UMLClass diagramshows a set of classes, interfaces, and collaborations and their relationships. It address the static design view of a system. Object diagramIt shows a set of objects and their relationships. Object diagrams represent static snapshots of instances of the things found in class diagrams. Component diagramIt shows an encapsulated class and its interfaces, ports, and internal structure consisting of nested components and connectors. Component diagrams address the static design implementation view of a system. They are important for building large systems from smaller parts.

2/7/201747jaya kolekar

Conceptual model of UMLUse case diagramIt shows a set of use cases and actors (a special kind of class) and their relationships. Use case diagrams address the static use case view of a system. These diagrams are especially important in organizing and modeling the behaviors of a system.Interaction diagramIt shows an interaction, consisting of a set of objects or roles, including the messages that may be dispatched among them. Interaction diagrams address the dynamic view of a system. Sequence diagramIt is an interaction diagram that emphasizes the time-ordering of messages2/7/201748jaya kolekar

Conceptual model of UMLCommunication diagramIt is an interaction diagram that emphasizes the structural organization of the objects or roles that send and receive messages.State diagramIt shows a state machine, consisting of states, transitions, events, and activities. It shows the dynamic view of an object.useful in modeling reactive systems.Activity diagramIt shows the structure of a process or other computation as the flow of control and data from step to step within the computation. It address the dynamic view of a system. They are especially important in modeling the function of a system and emphasize the flow of control among objects2/7/201749jaya kolekar

Conceptual model of UMLDeployment diagramIt shows the configuration of run-time processing nodes and the components that live on them. Deployment diagrams address the static deployment view of an architecture.Package diagramIt shows the decomposition of the model itself into organization units and their dependencies.Timing diagramis an interaction diagram that shows actual times across different objects or roles, as opposed to just relative sequences of messages. Interaction overview diagramis a hybrid of an activity diagram and a sequence diagram.2/7/201750jaya kolekar

Conceptual model of UMLRules of the UMLIt specify what a well-formed model should look like. Awell-formed modelis one that is semantically self-consistent and in harmony with all its related models.The UML has syntactic and semantic rules forNames What you can call things, relationships, and diagramsScope The context that gives specific meaning to a nameVisibility How those names can be seen and used by othersIntegrity How things properly and consistently relate to one anotherExecution What it means to run or simulate a dynamic modelModels viewed by many stakeholders in different ways and at different times. For this reason, it is common for the development team to not only build models that are well-formed, but also to build models that areElided Certain elements are hidden to simplify the viewIncomplete Certain elements may be missingInconsistent The integrity of the model is not guaranteed The rules of the UML encourage you but do not force you to address the most important analysis, design, and implementation questions that push such models to become well-formed over time.2/7/201751jaya kolekar

Conceptual model of UMLCommon Mechanisms in the UMLIt is made simpler by the presence of four common mechanisms that apply consistently throughout the language.SpecificationsAdornmentsCommon divisionsExtensibility mechanisms2/7/201752jaya kolekar

Conceptual model of UMLSpecificationsThe UML is a graphical language in every part of its graphical notation there is a specification that provides a textual statement of the syntax and semantics of that building block. For example, behind a class icon is a specification that provides the full set of attributes, operations, and behaviors that the class embodies. visually, that class icon might only show a small part of this specification. we use the UML's graphical notation to visualize a system and the UML's specification to state the system's details. Build up a model incrementally by drawing diagrams and then adding semantics to the model's specifications, or reverse engineering.

2/7/201753jaya kolekar

Conceptual model of UMLAdornmentsEvery element in the UML's notation starts with a basic symbol, to which can be added a variety of adornments specific to that symbol.For example , the class notation also exposes the most important aspects of a class, namely its name, attributes, and operations.A class's specification may include other details, such as whether it is abstract or the visibility of its attributes and operations. Many of these details can be rendered as graphical or textual adornments to the class's basic rectangular notation.

2/7/201754jaya kolekar

Conceptual model of UMLCommon DivisionsIn modeling object-oriented systems, the world often gets divided in several ways.

The division of class and object.

A class is an abstraction; an object is one concrete manifestation of that abstraction. Graphically, the UML distinguishes an object by using the same symbol as its class and then simply underlying the object's name.

2/7/201755jaya kolekar

Conceptual model of UMLSeparation of interface and implementation. An interface declares a contract, and an implementation represents one concrete realization of that contract, responsible for faithfully carrying out the interface's complete semantics.

Separation of type and role. The type declares the class of an entity, such as an object, an attribute, or a parameter. A role describes the meaning of an entity within its context, such as a class, component, or collaboration

2/7/201756jaya kolekar

Conceptual model of UMLExtensibility MechanismsThe UML provides a standard language for writing software blueprints, but it is not sufficient to express all possible nuances of all models across all domains across all time. For this reason, the UML is opened-ended, making it possible for you to extend the language in controlled ways.Extensibility mechanisms allow you to shape and grow the UML to your project's needs. You can add new building blocks, modify the specification of existing ones, and even change their semantics. The UML's extensibility mechanisms includeStereotypesextends the vocabulary of the UML, allowing you to create new kinds of building blocks that are derived from existing ones but that are specific to your problem.

Tagged valuesextends the properties of a UML stereotype, allowing you to create new information in the stereotype's specification.

Constraintsextends the semantics of a UML building block, allowing you to add new rules or modify existing ones. 2/7/201757jaya kolekar

Modeling System's ArchitectureDifferent stakeholders bring different agendas to a project, and looks at that system in different ways at different times over the project's life.

Used to manage these different viewpoints and thus control the iterative and incremental development of a system throughout its life cycle.2/7/201758jaya kolekar

Modeling System's ArchitectureArchitecture is the set of significant decisions aboutThe organization of a software system.The selection of the structural elements and their interfaces by which the system is composed.Their behavior.The composition of these structural and behavioral elements into progressively larger subsystems.The architectural style that guides this organization: the static and dynamic elements and their interfaces, their collaborations, and their composition.Software architecture is not only concerned with structure and behavior but also with usage, functionality, performance, resilience, reuse, comprehensibility, economic and technology constraints and trade-offs, and aesthetic concerns.2/7/201759jaya kolekar

Modeling System's Architecture2/7/201760jaya kolekar

Modeling System's ArchitectureUse case view Encompasses the use cases that describe the behavior of the system as seen by its end users, analysts, and testers.

This view doesn't really specify the organization of a software system. Rather, it exists to specify the forces that shape the system's architecture.

With the UML, the static aspects of this view are captured in use case diagrams; the dynamic aspects of this view are captured in interaction diagrams, state diagrams, and activity diagrams.Design viewEncompasses the classes, interfaces, and collaborations that form the vocabulary of the problem and its solution.

This view primarily supports the functional requirements of the system, meaning the services that the system should provide to its end users.

With the UML, the static aspects of this view are captured in class diagrams and object diagrams; the dynamic aspects of this view are captured in interaction diagrams, state diagrams, and activity diagrams. The internal structure diagram of a class is particularly useful.

2/7/201761jaya kolekar

Modeling System's ArchitectureInteraction view

Shows the flow of control among its various parts, including possible concurrency and synchronization mechanisms.

This view primarily addresses the performance, scalability, and throughput of the system.

With the UML, the static and dynamic aspects of this view are captured in the same kinds of diagrams as for the design view, but with a focus on the active classes that control the system and the messages that flow between them.

2/7/201762jaya kolekar

Modeling System's ArchitectureImplementation view Encompasses the artifacts that are used to assemble and release the physical system. This view primarily addresses the configuration management of the system's releases, made up of somewhat independent files that can be assembled in various ways to produce a running system. It is also concerned with the mapping from logical classes and components to physical artifacts. With the UML, the static aspects of this view are captured in artifact diagrams; the dynamic aspects of this view are captured in interaction diagrams, state diagrams, and activity diagrams.Deployment view Encompasses the nodes that form the system's hardware topology on which the system executes. This view primarily addresses the distribution, delivery, and installation of the parts that make up the physical system. With the UML, the static aspects of this view are captured in deployment diagrams; the dynamic aspects of this view are captured in interaction diagrams, state diagrams, and activity diagrams.

Each of these five views can stand alone so that different stakeholders can focus on the issues of the system's architecture that most concern them. T

2/7/201763jaya kolekar

Software Development Life Cycle

2/7/201764jaya kolekar

Software Development Life Cycle

Inception The seed idea for the development is brought up to the point.Elaboration When the product requirements and architecture are defined. In this phase, the requirements are articulated, prioritized, and base lined.

ConstructionWhen the software is brought from an executable architectural baseline to being ready to be transitioned to the user community. Here also, the system's requirements and especially its evaluation criteria are constantly reexamined against the business needs of the project, and resources are allocated as appropriate to actively attack risks to the project.TransitionThe software is delivered to the user community. During this phase, the system is continuously improved, bugs are eradicated, and features that didn't make an earlier release are added.Iteration It is a distinct set of work tasks, with a base lined plan and evaluation criteria that results in an executable system that can be run, tested, and evaluated.

2/7/201765jaya kolekar