object oriented and analysis

download object oriented and analysis

of 10

Transcript of object oriented and analysis

  • 8/7/2019 object oriented and analysis

    1/10

    HOME WORK 4Subject:

    Object Oriented Analysis & DesignCAP365

    Submitted To:Shakti Kundu Submitted By: sandeep singhRA3802A31

    BCA HONS. MCAREG NO.10811055

  • 8/7/2019 object oriented and analysis

    2/10

    PART A

    Q.1. Take any real world example to describe the environment and need ofobject diagram, Collaboration diagram and Sequence diagram in UMLmodelling?Ans:

    UML object diagrams, sometimes referred to as instance diagrams,are useful for exploring real world examples of objects and therelationships between them. Although UML class diagrams are very goodat describing this very information some people find them too abstract aUML object diagram can be a good option for explaining complexrelationships between classes.

    A sequence diagram shows, as parallel vertical lines (lifelines), different

    processes or objects that live simultaneously, and, as horizontal arrows,the messages exchanged between them, in the order in which they occur.This allows the specification of simple runtime scenarios in a graphicalmanner. For instance, the UML 1.x diagram on the right describes thesequences of messages of a (simple) restaurant system. This diagramrepresents a Patron ordering food and wine, drinking wine then eating thefood, and finally paying for the food. The dotted lines extending downwardsindicate the timeline. Time flows from top to bottom. The arrows representmessages (stimuli) from an actor or object to other objects. For example,the Patron sends message 'pay' to the Cashier. Half arrows indicateasynchronous method calls.

    Component diagrams, along with UML Activity diagrams are arguably oneof the forgotten UML diagrams. Few books invest much time discussingthem, I suspect the primary reason for this is because most methodologistsappear to relegate them to low-level design diagrams for specifying theconfiguration of your software. UML Deployment diagrams are preferredby most modelers for this task, not only can you define what you intend todeploy you can also indicate where you intend to deploy it with deployment

    diagrams, and most programmers prefer to use their configurationmanagement system to define configurations. UML Component diagramsbecome much more useful when used as architectural-level artifacts,perhaps used to model the logical architecture of your technical orbusiness/domain infrastructures.

    http://www.agilemodeling.com/artifacts/activityDiagram.htmhttp://www.agilemodeling.com/artifacts/activityDiagram.htm
  • 8/7/2019 object oriented and analysis

    3/10

    Q.2. How Component diagrams are useful in UML Modelling. Explain withthe help of examples?

    Ans: In Visual Studio Ultimate, a component diagram shows the parts of adesign for a software system. A component diagram helps you visualize thehigh-level structure of the system and the service behavior that thosepieces provide and consume through interfaces. To create a UMLcomponent diagram, on the Architecture menu, click New Diagram.

    You can use a component diagram to describe a design that isimplemented in any language or style. It is only necessary to identify partsof the design that interact with the other parts of the design through arestricted set of inputs and outputs. The components can be of any scale,and can be interconnected in any manner.

    Example:

  • 8/7/2019 object oriented and analysis

    4/10

    Q.3. How message passing take place in Collaboration and Sequence

    diagram?

    Ans:

    we can explain the messing passing between collaboration and

    sequence diagram with the help of below example:-

    An example of messages being sent between objects

    Besides just showing message calls on the sequence diagram, the Figure 4diagram includes return messages. These return messages are optional; areturn message is drawn as a dotted line with an open arrowhead back to

    the originating lifeline, and above this dotted line you place the return valuefrom the operation. In Figure 4 the secSystem object returns userClearanceto the system object when the getSecurityClearance method is called. Thesystem object returns availableReports when the getAvailableReportsmethod is called.

    Again, the return messages are an optional part of a sequence diagram.The use of return messages depends on the level of detail/abstraction thatis being modeled. Return messages are useful if finer detail is required;otherwise, the invocation message is sufficient. I personally like to include

    return messages whenever a value will be returned, because I find theextra details make a sequence diagram easier to read.

  • 8/7/2019 object oriented and analysis

    5/10

    A sequence diagram fragment showing an asynchronous message

    being sent to instance2

    PART B

    Q.4. Illustrate the concept of events and signals in UML by taking suitable

    examples?

    Ans: signals in uml:

    In UML models, signals are model elements that are independent of theclassifiers that handle them. Signals specify one-way, asynchronouscommunications between active objects.

    Signals are often used in event-driven systems and distributed computingenvironments. For example, a communications system might contain aPager class, whose objects wait for, and respond to, Page signals. Signalsdiffer from other message types in that when an object receives a signal,the object does not need to return anything, but reacts to the receipt of asignal according to the behavior specified by its receptions.

  • 8/7/2019 object oriented and analysis

    6/10

    All signals are assumed to have a send( ) operation. A signals attributesrepresent the data it carries in its send operation. Signals can have noother operations.

    You can add signals to the class diagrams in your model to represent thefollowing functions:

    Trigger events in objects in models that represent event-drivensystems

    Exceptions thrown by an operation when something unexpectedoccurs in a software system

    A signal has a name describing its purpose in the system. As the followingfigure illustrates, the UML notation for a signal is a rectangle with two

    compartments.

    The upper compartment contains the signal keyword and thesignals name.

    The lower compartment contains the signals attributes.

    Events in uml:

    The smallest part of intraction is called an event. An event is any point in anintraction where something occurs.

    Event are the building block for signal and messages.

    Q.5. Elaborate State Machine? Draw a Deployment Diagram for a softwarecompany by showing its nodes, and their relationships?

    Ans: state machine:Objects have both behavior and state or, in other

    words, they do things and they know things. Some objects do and knowmore things, or at least more complicated things, than other objects. Some

  • 8/7/2019 object oriented and analysis

    7/10

    objects are incredibly complicated, so complex that developers can havedifficulty understanding them. To understand complex classes better,particularly those that act in different manners depending on their state, youshould develop one or more UML state machine diagrams.UML state machine diagrams depict the various states that an object maybe in and the transitions between those states. In fact, in other modelinglanguages, it is common for this type of a diagram to be called a state-transition diagram or even simply a state diagram. A state represents astage in the behavior pattern of an object, and like UML activity diagrams itis possible to have initial states and final states. An initial state, also calleda creation state, is the one that an object is in when it is first created,whereas a final state is one in which no transitions lead out of. A transitionis a progression from one state to another and will be triggered by an eventthat is either internal or external to the object.

    Deployement diagram for a software company:

  • 8/7/2019 object oriented and analysis

    8/10

    Q.6. Draw Component and Deployment diagrams for a large multinationalcompany?Ans: component diagram for a multinational company

  • 8/7/2019 object oriented and analysis

    9/10

    deployment diagram for a multinational company

  • 8/7/2019 object oriented and analysis

    10/10