Sunteți pe pagina 1din 38

S No.

1 2 3 4 5 6

NAME OF THE EXPERIMENT UML INTRODUCTION A POINT-OF-SALES SYSTEM ONLINE BOOKSHOP AN AUCTION APPLICATION A MULTI THREADED AIRPORT SIMULATION A SIMULATED COMPANY

PAGE No.

REMARKS

UNIFIED MODELING LANGUAGE

Page | 1

UML INTRODUCTION

STUDY OF UML AIM: General study of UML

DESCRIPTION:
The heart of object-oriented problem solving is the construction of a model. The model abstracts the essential details of the underlying problem from its usually complicated real world. Several modeling tools are wrapped under the heading of the UML, which stands for Unified Modeling Language. The purpose of this course is to present important highlights of the UML.

UNIFIED MODELING LANGUAGE

Page | 2

CLASS
A class is a blueprint or prototype from which objects are created. This section defines a class that models the state and behavior of a real-world object. It intentionally focuses on the basics, showing how even simple classes can cleanly model state and behavior. For example, the class Dog would consist of traits shared by all dogs, such as breed and fur color (characteristics), and the ability to bark and sit (behaviors).

OBJECT
An object is a software bundle of related state and behavior. Software objects are often used to model the real-world objects that you find in everyday life. This lesson explains how state and behavior are represented within an object, introduces the concept of data encapsulation, and explains the benefits of designing your software in this manner. A pattern (exemplar) of a class. The class Dog defines all possible dogs by listing the characteristics and behaviors they can have; the object Lassie is one particular dog, with particular versions of the characteristics. A Dog has fur; Lassie has brown-and-white fur.

OBJECT ORIENTATION CONCEPTS:


Object-Orientation goes beyond just modeling attributes and behavior. It considers the other aspects of objects as well. Object-oriented programming (OOP) is a programming paradigm that uses "objects" data structures consisting of data fields and methods together with their interactions to design applications and computer programs. Programming techniques may include features such as data abstraction, encapsulation, modularity, polymorphism, and inheritance. These aspects are called abstraction, Inheritance, polymorphism and encapsulation.

ABSTRACTION:
Abstraction is simplifying complex reality by modeling classes appropriate to the problem, and working at the most appropriate level of inheritance for a given aspect of the problem. For example, Lassie the Dog may be treated as a Dog much of the time, a Collie when necessary to access Collie-specific attributes or behaviors, and as an Animal (perhaps the parent class of Dog) when counting Timmy's pets. Abstraction is also achieved through Composition. For example, a class

ENCAPSULATION:
Encapsulation conceals the functional details of a class from objects that send messages to it.
UNIFIED MODELING LANGUAGE Page | 3

For example, the Dog class has a bark () method. The code for the bark() method defines exactly how a bark happens (e.g., by inhale() and then exhale(), at a particular pitch and volume). Timmy, Lassie's friend, however, does not need to know exactly how she barks. Encapsulation is achieved by specifying which classes may use the members of an object. The result is that each object exposes to any class a certain interface those members accessible to that class. The reason for encapsulation is to prevent clients of an interface from depending on those parts of the implementation that are likely to change in the future, thereby allowing those changes to be made more easily, that is, without changes to clients. For example, an interface can ensure that puppies can only be added to an object of the class Dog by code in that class. Members are often specified as public, protected or private, determining whether they are available to all classes, sub-classes or only the defining class. Some languages go further: Java uses the default access modifier to restrict access also to classes in the same package, C# and VB.NET reserve some members to classes in the same assembly using keywords internal (C#) or Friend (VB.NET), and Eiffel and C++ allow one to specify which classes may access any member.

POLYMORPHISM:
Polymorphism allows the programmer to treat derived class members just like their parent class's members. More precisely, Polymorphism in object-oriented programming is the ability of objects belonging to different data types to respond to calls of methods of the same name, each one according to an appropriate type-specific behavior. One method, or an operator such as +, -, or *, can be abstractly applied in many different situations. If a Dog is commanded to speak(), this may elicit a bark(). However, if a Pig is commanded to speak(), this may elicit an oink(). Each subclass overrides the speak() method inherited from the parent class Animal.

INHERITANCE:
Subclasses are more specialized versions of a class, which inherit attributes and behaviors from their parent classes, and can introduce their own. For example, the class Dog might have sub-classes called Collie, Chihuahua, and Golden Retriever. In this case, Lassie would be an instance of the Collie subclass. Suppose the Dog class defines a method called bark() and a property called fur Color. Each of its sub-classes (Collie, Chihuahua, and Golden Retriever) will inherit these members, meaning that the programmer only needs to write the code for them once. Each subclass can alter its inherited traits. For example, the Collie subclass might specify that the default four-Color for a collie is brown-and-white. The Chihuahua subclass might specify that the bark() method produces a high pitch by default. Subclasses can also add new members. The Chihuahua subclass could add a method called tremble (). So an individual Chihuahua
UNIFIED MODELING LANGUAGE Page | 4

instance would use a high-pitched bark () from the Chihuahua subclass, which in turn inherited the usual bark () from Dog. The Chihuahua object would also have the tremble () method, but Lassie would not, because she is a Collie, not a Chihuahua. In fact, inheritance is an "a... is a" relationship between classes, while instantiation is an "is a" relationship between an object and a class: a Collie is a Dog ("a... is a"), but Lassie is a Collie ("is a"). Thus, the object named Lassie has the methods from both classes Collie and Dog. Multiple inheritances are inheritance from more than one ancestor class, neither of these ancestors being an ancestor of the other. For example, independent classes could define Dogs and Cats, and a Chimera object could be created from these two which inherits all the (multiple) behavior of cats and dogs. This is not always supported, as it can be hard to implement At the center of the UML are its nine kinds of modeling diagrams, which we describe here.

Use case diagrams Class diagrams Object diagrams Sequence diagrams Collaboration diagrams State chart diagrams Activity diagrams Component diagrams Deployment diagrams Let's look at this question from the point of view of the construction trade. Architects

Why is UML important? design buildings. Builders use the designs to create buildings. The more complicated the building, the more critical the communication between architect and builder. Blueprints are the standard graphical language that both architects and builders must learn as part of their trade. Writing software is not unlike constructing a building. The more complicated the underlying system, the more critical the communication among everyone involved in creating and deploying the software. In the past decade, the UML has emerged as the software blueprint language for analysts, designers, and programmers alike. It is now part of the software trade. The UML gives everyone from business analyst to designer to programmer a common vocabulary to talk about software design. The UML is applicable to object-oriented problem solving. Anyone interested in learning UML must be familiar with the underlying tenet of object-oriented problem solving -- it all begins with the construction of a model. A model is an abstraction of the underlying problem. The domain is the actual world from which the problem comes. Models consist of objects that interact
UNIFIED MODELING LANGUAGE Page | 5

by sending each other messages. Think of an object as "alive." Objects have things they know (attributes) and things they can do (behaviors or operations). The values of an object's attributes determine its state. Classes are the "blueprints" for objects. A class wraps attributes (data) and behaviors (methods or functions) into a single distinct entity. Objects are instances of classes.

Use case diagrams:


Use case diagrams describe what a system does from the standpoint of an external observer. The emphasis is on what a system does rather than how. Use case diagrams are closely connected to scenarios. A scenario is an example of what happens when someone interacts with the system. Here is a scenario for a medical clinic. "A patient calls the clinic to make an appointment for a yearly checkup. The receptionist finds the nearest empty time slot in the appointment book and schedules the appointment for that time slot. " A use case is a summary of scenarios for a single task or goal. An actor is who or what initiates the events involved in that task. Actors are simply roles that people or objects play. The picture below is a Make Appointment use case for the medical clinic. The actor is a Patient. The connection between actor and use case is a communication association (or communication for short).

Actors are stick figures. Use cases are ovals. Communications are lines that link actors to use cases. A use case diagram is a collection of actors, use cases, and their communications. We've put Make Appointment as part of a diagram with four actors and four use cases. Notice that a single use case can have multiple actors.

UNIFIED MODELING LANGUAGE

Page | 6

Use case diagrams are helpful in three areas.

Determining features (requirements). New use cases often generate new requirements as the system is analyzed and the design takes shape. Communicating with clients. Their notational simplicity makes use case diagrams a good way for developers to communicate with clients. Generating test cases. The collection of scenarios for a use case may suggest a suite of test cases for those scenarios.

Class diagrams:
A Class diagram gives an overview of a system by showing its classes and the relationships among them. Class diagrams are static -- they display what interacts but not what happens when they do interact. The class diagrams below models a customer order from a retail catalog. The central class is the Order. Associated with it is the Customer making the purchase and the Payment? A Payment is one of three kinds: Cash, Check, or Credit. The order contains Order Details (line items), each with its associated Item.

UNIFIED MODELING LANGUAGE

Page | 7

UML class notation is a rectangle divided into three parts: class name, attributes, and operations. Names of abstract classes, such as Payment, are in italics. Relationships between classes are the connecting links. Our class diagram has three kinds of relationships.

Association -- a relationship between instances of the two classes. There is an association between two classes if an instance of one class must know about the other in order to Perform its work. In a diagram, an association is a link connecting two classes. Aggregation -- an association in which one class belongs to a collection. An aggregation has a diamond end pointing to the part containing the whole. In our diagram, Order has a collection of Order Details.

Generalization -- an inheritance link indicating one class is a super class of the other. A generalization has a triangle pointing to the super class. Payment is a super class of Cash, Check, and Credit.

An association has two ends. An end may have a role name to clarify the nature of the association. For example, an Order Detail is a line item of each Order. A navigability arrow on an association shows which direction the association can be traversed or queried. An Order Detail can be queried about its Item, but not the other way around. The arrow also lets you know who "owns" the association's implementation; in this case, Order Detail has an Item. Associations with no navigability arrows are bi-directional. The multiplicity of an association end is the number of possible instances of the class associated with a single instance of the other end. Multiplicities are single numbers or ranges of numbers. In our example, there can be only one Customer for each Order, but a Customer can have any number of Orders. This table gives the most common multiplicities.
UNIFIED MODELING LANGUAGE Page | 8

Multiplicities 0..1 0..* or * 1 1..*

Meaning zero or one instance. The notation n . . m indicates n to m instances. no limit on the number of instances (including none). exactly one instance at least one instance

Every class diagram has classes, associations, and multiplicities. Navigability and roles are optional items placed in a diagram to provide clarity. Packages and object diagrams To simplify complex class diagrams, you can group classes into packages. A package is a collection of logically related UML elements. The diagram below is a business model in which the classes are grouped into packages.

Packages appear as rectangles with small tabs at the top. The package name is on the tab or inside the rectangle. The dotted arrows are dependencies. One package depends on another if changes in the other could possibly force changes in the first. Object diagrams show instances instead of classes. They are useful for explaining small pieces with complicated relationships, especially recursive relationships. This small class diagram shows that a university Department can contain lots of other Departments.

UNIFIED MODELING LANGUAGE

Page | 9

The object diagram below instantiates the class diagram, replacing it by a concrete example.

Each rectangle in the object diagram corresponds to a single instance. Instance names are underlined in UML diagrams. Class or instance names may be omitted from object diagrams as long as the diagram meaning is still clear.

Sequence diagrams:
Class and object diagrams are static model views. Interaction diagrams are dynamic. They describe how objects collaborate. A sequence diagram is an interaction diagram that details how operations are carried out -- what messages are sent and when. Sequence diagrams are organized according to time. The time progresses as you go down the page. The objects involved in the operation are listed from left to right according to when they take part in the message sequence. Below is a sequence diagram for making a hotel reservation. The object initiating the sequence of messages is a Reservation window.

UNIFIED MODELING LANGUAGE

Page | 10

The Reservation window sends a make Reservation () message to a Hotel Chain. The Hotel Chain then sends a make Reservation () message to a Hotel. If the Hotel has available rooms, then it makes a Reservation and a Confirmation. Each vertical dotted line is a lifeline, representing the time that an object exists. Each arrow is a message call. An arrow goes from the sender to the top of the activation bar of the message on the receiver's lifeline. The activation bar represents the duration of execution of the message. In our diagram, the Hotel issues a self call to determine if a room is available. If so, then the Hotel creates a Reservation and a Confirmation. The asterisk on the self call means iteration (to make sure there is available room for each day of the stay in the hotel). The expression in square brackets, [ ], is a condition.

Collaboration diagrams:
Collaboration diagrams are also interaction diagrams. They convey the same information as sequence diagrams, but they focus on object roles instead of the times that messages are sent. In a sequence diagram, object roles are the vertices and messages are the connecting links.

UNIFIED MODELING LANGUAGE

Page | 11

The object-role rectangles are labeled with either class or object names (or both). Class names are preceded by colons (: ). Each message in a collaboration diagram has a sequence number. The top-level message is numbered 1. Messages at the same level (sent during the same call) have the same decimal prefix but suffixes of 1, 2, etc. according to when they occur.

State chart diagrams:


Objects have behaviors and state. The state of an object depends on its current activity or condition. A state chart diagram shows the possible states of the object and the transitions that cause a change in state. Our example diagram models the login part of an online banking system. Logging in consists of entering a valid social security number and personal id number, then submitting the information for validation. Logging in can be factored into four non-overlapping states: Getting SSN, Getting PIN, Validating, and Rejecting. From each state comes a complete set of transitions that determine the subsequent state.

UNIFIED MODELING LANGUAGE

Page | 12

States are rounded rectangles. Transitions are arrows from one state to another. Events or conditions that trigger transitions are written beside the arrows. Our diagram has two selftransitions, one on Getting SSN and another on Getting PIN. The initial state (black circle) is a dummy to start the action. Final states are also dummy states that terminate the action. The action that occurs as a result of an event or condition is expressed in the form /action. While in its Validating state, the object does not wait for an outside event to trigger a transition. Instead, it performs an activity. The result of that activity determines its subsequent state.

Activity diagrams:
An activity diagram is essentially a fancy flowchart. Activity diagrams and state chart diagrams are related. While a state chart diagram focuses attention on an object undergoing a process (or on a process as an object), an activity diagram focuses on the flow of activities involved in a single process. The activity diagram shows the how those activities depend on one another. For our example, we used the following process. "Withdraw money from a bank account through an ATM." The three involved classes (people, etc.) of the activity are Customer, ATM, and Bank. The process begins at the black start, circle at the top and ends at the concentric white/black stop circles at the bottom. The activities are rounded rectangles.
UNIFIED MODELING LANGUAGE Page | 13

Activity diagrams can be divided into object swim-lanes that determine which object is responsible for which activity. A single transition comes out of each activity, connecting it to the next activity. A transition may branch into two or more mutually exclusive transitions. Guard expressions (inside [ ]) label the transitions coming out of a branch. A branch and its subsequent merge marking the end of the branch appear in the diagram as hollow diamonds. A transition may fork into two or more parallel activities. The fork and the subsequent join of the threads coming out of the fork appear in the diagram as solid bars.

Component and deployment diagrams:


A component is a code module. Component diagrams are physical analogs of class diagram. Deployment diagrams show the physical configurations of software and hardware. The following deployment diagram shows the relationships among software and hardware components involved in real estate transactions.
UNIFIED MODELING LANGUAGE Page | 14

The physical hardware is made up of nodes. Each component belongs on a node. Components are shown as rectangles with two tabs at the upper left.

STEPS FOR MODELING UML DIAGRAMS Modeling steps for Use case Diagram:
1. 2. 3. 4.

Draw the lines around the system and actors lie outside the system. Identify the actors which are interacting with the system. Separate the generalized and specialized actors. Identify the functionality the way of interacting actors with system and specify the behavior of actor. Functionality or behavior of actors is considered as use cases. Specify the generalized and specialized use cases. Se the relationship among the use cases and in between actor and use cases.
Page | 15

5. 6. 7.

UNIFIED MODELING LANGUAGE

8. 9.

Adorn with constraints and notes. If necessary, use collaborations to realize use cases.

Modeling steps for Sequence Diagram:


1.

Set the context for the interactions, system, subsystem, classes, object or use cases. Set the stages for the interactions by identifying objects which are placed as actions in interaction diagrams. Lay them out along the X-axis by placing the important object at the left side and others in the next subsequent. Set the lifelines for each and every object by sending create and destroy messages. Start the message which is initiating interactions and place all other messages in the increasing order of items. Specify the time and space constraints. Set the pre and post conditioned.

2.

3.

4.

5.

6. 7.

Modeling steps for Collaboration Diagram:


1.

Set the context for interaction, whether it is system, subsystem, operation or class or one scenario of use case or collaboration. Identify the objects that play a role in the interaction. Lay them as vertices in graph, placing important objects in centre and neighboring objects to outside. Set the initial properties of each of these objects. If the attributes or tagged values of an object changes in significant ways over the interaction, place a duplicate object, update with these new values and connect them by a message stereotyped as become or copy.

2.

3.

4.

Specify the links among these objects. Lay the association links first represent structural connection. Lay out other links and adorn with stereotypes. Starting with the message that initiates this interaction, attach each subsequent message to appropriate link, setting sequence number as appropriate. Adorn each message with time and space constraints if needed Attach pre & post conditions to specify flow of control formally.

5.

6. 7.

Modeling steps for Activity Diagram:


UNIFIED MODELING LANGUAGE Page | 16

1. 2.

Select the object that has high level responsibilities. These objects may be real or abstract. In either case, create a swim-lane for each important object. Identify the precondition of initial state and post conditions of final state. Beginning at initial state, specify the activities and actions and render them as activity states or action states. For complicated actions, or for a set of actions that appear multiple times, collapse these states and provide separate activity diagram. Render the transitions that connect these activities and action states. Start with sequential flows. Consider branching, fork and joining. Adorn with notes tagged values and so on.

3. 4.

5.

6. 7. 8.

Modeling steps for State chart Diagram:


1.

Choose the context for state machine, whether it is a class, a use case, or the system as a whole. Choose the initial & final states of the objects. Decide on the stable states of the object by considering the conditions in which the object may exist for some identifiable period of time. The high-level states of the objects & only then consider its possible substates. Decide on the meaningful partial ordering of stable states over the lifetime of the object. Decide on the events that may trigger a transition from state to state. Model these events as triggers to transitions that move from one legal ordering of states to another.

2. 3.

4.

5.

6.

7. 8.

Attach actions to these transitions and/or to these states. Consider ways to simplify your machine by using sub states, branches, forks, joins and history states. Check that all states are reachable under some combination of events. Check that no state is a dead from which no combination of events will transition the object out of that state. Trace through the state machine, either manually or by using tools, to check it against expected sequence of events & their responses.

9. 10.

11.

Modeling steps for Class Diagram:


UNIFIED MODELING LANGUAGE Page | 17

1. 2. 3. 4. 5. 6.

Identity the things that are interacting with class diagram. Set the attributes and operations. Set the responsibilities. Identify the generalization and specification classes. Set the relationship among all the things. Adorn with tagged values, constraints and notes.

Modeling steps for Object Diagram:


1. 2.

Identify the mechanisms which you would like to model. Identify the classes, use cases, interface, subsystem which are collaborated with mechanisms. Identify the relationship among all objects. Walk through the scenario until to reach the certain point and identify the objects at that point. Render all these classes as objects in diagram. Specify the links among all these objects. Set the values of attributes and states of objects.

3. 4.

5. 6. 7.

Modeling steps for Component Diagram:


1.

Identify the component libraries and executable files which are interacting with the system. Represent this executables and libraries as components. Show the relationships among all the components. Identify the files, tables, documents which are interacting with the system. Represent files, tables, documents as components. Show the existing relationships among them generally dependency. Identify the seams in the model. Identify the interfaces which are interacting with the system. Set attributes and operation signatures for interfaces. Use either import or export relationship in b/w interfaces & components. Identify the source code which is interacting with the system. Set the version of the source code as a constraint to each source code. Represent source code as components. Show the relationships among components. Adorn with nodes, constraints and tag values.
Page | 18

2. 3. 4. 5. 6. 7. 8. 9. 10. 11. 12. 13. 14. 15.

UNIFIED MODELING LANGUAGE

Modeling steps for Deployment Diagram:


1. 2. 3. 4. 5. 6. 7.

Identify the processors which represent client & server. Provide the visual cue via stereotype classes. Group all the similar clients into one package. Provide the links among clients & servers. Provide the attributes & operations. Specify the components which are living on nodes. Adorn with nodes & constraints & draw the deployment diagram.

APPLICATION OF RATIONAL ROSE TO UML:


Rational Rose was developed by IBM Corporation in order to develop a software system based on the concepts of Object Oriented Analysis and Design approach as developed from the models of Grady Booch, Jacobson and Ram Baugh methodologies, resulting into a Unified approach. Rational Rose is an object-oriented Unified Modeling Language (UML) software design tool intended for visual modeling and component construction of enterprise-level software applications. In much the same way a theatrical director blocks out a play, a software designer uses Rational Rose to visually create (model) the framework for an application by blocking out classes with actors (stick figures), use case elements (ovals), objects (rectangles) and messages/relationships (arrows) in a sequence diagram using drag-and-drop symbols. Rational Rose documents the diagram as it is being constructed and then generates code in the designer's choice of C++, Visual Basic, Java, Oracle8, CORBA or Data Definition Language. Two popular features of Rational Rose are its ability to provide iterative development and round-trip engineering. Rational Rose allows designers to take advantage of iterative development (sometimes called evolutionary development) because the new application can be created in stages with the output of one iteration becoming the input to the next. (This is in contrast to waterfall development where the whole project is completed from start to finish before a user gets to try it out.) Then, as the developer begins to understand how the components interact and makes modifications in the design, Rational Rose can perform what is called "round-trip engineering" by going back and updating the rest of the model to ensure the code remains consistent. The overall model contains classes, use cases, objects, packages, operations, component packages, components, processors, devices and the relationship between them. Each of these model elements possess model properties that identify and characterize them.

UNIFIED MODELING LANGUAGE

Page | 19

A model also contains diagrams and specifications, which provides a means of visualizing and manipulating the models elements and their model properties. Since diagram is used to illustrate multiple views of a model, icons representing a model element can appear in none, or several of a models diagrams. The application therefore enables you to control, which element, relationship and property icons appear on each diagram, using facilities provided by its application window. Within its application window, it displays each diagram in a diagram window and each specification in a specification window. It provides a separate tool, called Model Integrator to compare and merge models and their controlled units. It also enables teams to reuse large- scale design assets developed in earlier modeling efforts by providing the possibility to add frame works in Rational Rose.

Point of Sale System

UNIFIED MODELING LANGUAGE

Page | 20

Point of Sale System

AIM: To create a Point of Sale System ACTORS: 1. customer


2.

cashier

USECASES: 1. Bar code scanning


2. 3. 4. 5. 6. 7.

Process sale Close sale Pay Bill. Tax calculation Buy product Update Inventory

UNIFIED MODELING LANGUAGE

Page | 21

ALGORITHMIC PROCEDURE: STEP 1: Start the application STEP 2: Create the require actors and use cases in the browser window STEP 3: Go to new use case view and then click the use case view and open a new package STEP 4: Rename the new package with the package with required names STEP 5: Create two packages actor and use case

Class diagram:

Use case Diagram:

UNIFIED MODELING LANGUAGE

Page | 22

Sequence diagram:

Collaboration diagram:

UNIFIED MODELING LANGUAGE

Page | 23

Activity diagram:

Component Diagram:

Deployment diagram:

UNIFIED MODELING LANGUAGE

Page | 24

RESULT:
Thus various UML Diagrams were generated for POINT OF SALE SYSTEM and the corresponding code was generated using Visual Basic.

UNIFIED MODELING LANGUAGE

Page | 25

ONLINE BOOK SHOP SYSTEM

UNIFIED MODELING LANGUAGE

Page | 26

ONLINE BOOKSHOP SYSTEM SPECIFICATIONS: Objectives:


The purpose of this document is to define requirements of the online bookshop system. This specification lists the requirements that are not readily captured in the use cases of the Use case model. The supplementary specifications and the use case model together capture a complete set of requirement on the system.

Scope:
The specification defines the non-functional requirements of the system, such as reliability, usability, performance and supportability. The functional requirements are defined in the use case specifications.

References:
Amazon.com, BN.com, Tigris.com

Functionality:
Multiple users must be able to perform work concurrently. The user must be notified about the stock of books in the inventory.

Usability:
The desktop user-interface shall be Windows 95, 98 compliant.

Reliability:
The system shall be available 24 hrs a day and 7 days a week.

Performance:

The system shall support large number of simultaneous users against the central database at any time. The system shall provide access to catalog database with no more then ten seconds latency. The system must be able to complete 80% of all transactions within 2 minutes.

Supportability:
UNIFIED MODELING LANGUAGE Page | 27

None

Brief Description of the Project:


The current project emphasizes on analysis and design of an online bookshop system. That serves the customers needs. The customers available activities in the proposed system from logging on the browsing the book store, selecting items and making purchases are described.

PROBLEM STATEMENT FOR ONLINE BOOKSHOP SYSTEM:


As a young promising student you are tasked with developing an online book shop system. The system should be competitive enough by providing the facilities/options that are currently provided by reputed systems like Amazon.com and BN.com. The proposed system should allow the customer with activities from logging on to the system, browsing the book store, selecting items and making purchases i.e., the customer will be able to browse, select and buy books online. An internet customer should have a login to access the book store. Registration of the customer with the book shop is primary. A registered customer can browse through the book catalogue and can make selections. The new system should even assist the customer in locating a book in that, the customer can browse the current book catalogue online and this should detail the book details and stock details for the books. The user should be able to filter by book title, author and book category. If the user cannot find a book in current category, they should place an order and request the book. This includes details like Author, Publishers, Title, Book Name and Category. The payment is done through credit card and also through gift cheques etc., the customer is informed about the transaction details through e-mails. The shipment details are entered by the customer and through those details the delivery is processed.

USE CASE
The use case model describes the proposed functionality of the system. A use case represents a discrete unit of interaction between a user and the system. A use case is a single unit of meaningful work. Each use case has a description which describes the functionality that will be
UNIFIED MODELING LANGUAGE Page | 28

built in a proposed system. A use case may include another use case functionality or extend another use case with its own behavior.

ACTORS:

Customer Amazon

USE CASES:

Registration Login Create order Book catalog Manage cart and payments Order status Inventory

RELATIONSHIPS USED:

Association Dependency Composition

Modeling steps for Use case Diagram:


1.

Draw the lines around the system and actors lie outside the system. Identify the actors which are interacting with the system. Separate the generalized and specialized actors. Identify the functionality the way of interacting actors with system and specify the Functionality or behavior of actors is considered as use cases. Specify the generalized and specialized use cases. See the relationship among the use cases and in between actor and use cases. If necessary, use collaborations to realize use cases.
Page | 29

2. 3.

behavior of actor.
4. 5. 6.

Adorn with constraints and notes.


7.

UNIFIED MODELING LANGUAGE

Modeling steps for Sequence Diagram:


1. Set the context for the interactions, system, subsystem, classes, object or use cases. 2. Set the stages for the interactions by identifying objects which are placed as actions in interaction diagrams. 3. Lay them out along the X-axis by placing the important object at the left side and others in the next subsequent. 4. Set the lifelines for each and every object by sending create and destroy messages. 5. Start the message which is initiating interactions and place all other messages in the increasing order of items. 6. Specify the time and space constraints. 7. Set the pre and post conditioned.

Modeling steps for Collaboration Diagram:


1.

Set the context for interaction, whether it is system, subsystem, operation or class Identify the objects that play a role in the interaction. Lay them as vertices in Set the initial properties of each of these objects. If the attributes or tagged values

or one scenario of use case or collaboration.


2.

graph, placing important objects in centre and neighboring objects to outside.


3.

of an object changes in significant ways over the interaction, place a duplicate object, update with these new values and connect them by a message stereotyped as become or copy.
4.

Specify the links among these objects. Lay the association links first represent Starting with the message that initiates this interaction, attach each subsequent Adorn each message with time and space constraints if needed Attach pre & post conditions to specify flow of control formally.

structural connection. Lay out other links and adorn with stereotypes.
5.

message to appropriate link, setting sequence number as appropriate.


6. 7.

Modeling steps for Activity Diagram:


1. 2.

Select the object that has high level responsibilities. These objects may be real or abstract. In either case, create a swim lane for each

important object.
UNIFIED MODELING LANGUAGE Page | 30

3. 4.

Identify the precondition of initial state and post conditions of final state. Beginning at initial state, specify the activities and actions and render them as For complicated actions, or for a set of actions that appear multiple times, collapse Render the transitions that connect these activities and action states. Start with sequential flows; consider branching, fork and joining. Adorn with notes tagged values and so on.

activity states or action states.


5.

these states and provide separate activity diagram.


6. 7. 8.

Modeling steps for State chart Diagram:


1.

Choose the context for state machine, whether it is a class, a use case, or the system Choose the initial & final states of the objects. Decide on the stable states of the object by considering the conditions in which the

as a whole.
2. 3.

object may exist for some identifiable period of time. Start with the high-level states of the objects & only then consider its possible substrates.
4.

Decide on the meaningful partial ordering of stable states over the lifetime of the Decide on the events that may trigger a transition from state to state. Model these Attach actions to these transitions and/or to these states. Consider ways to simplify your machine by using sub states, branches, forks, joins Check that all states are reachable under some combination of events. Check that no state is a dead from which no combination of events will transition 10. Trace through the state machine, either manually or by using tools, to check it against expected sequence of events & their responses.

object.
5.

events as triggers to transitions that move from one legal ordering of states to another.
6. 7.

and history states.


8. 9.

the object out of that state.

Modeling steps for Class Diagram:


UNIFIED MODELING LANGUAGE Page | 31

1. 2. 3. 4. 5. 6.

Identity the things that are interacting with class diagram. Set the attributes and operations. Set the responsibilities. Identify the generalization and specification classes. Set the relationship among all the things. Adorn with tagged values, constraints and notes.

Modeling steps for Object Diagram:


1. 2.

Identify the mechanisms which you would like to model. Identify the classes, use cases, interface, subsystem which are collaborated with Identify the relationship among all objects. Walk through the scenario until to reach the certain point and identify the objects at Render all these classes as objects in diagram. Specify the links among all these objects. Set the values of attributes and states of objects.

mechanisms.
3. 4.

that point.
5. 6. 7.

Modeling steps for Component Diagram:


1.

Identify the component libraries and executable files which are interacting with the system. Represent this executables and libraries as components. Show the relationships among all the components. Identify the files, tables, documents which are interacting with the system. Represent files, tables, documents as components. Show the existing relationships among them generally dependency. Identify the seams in the model. Identify the interfaces which are interacting with the system. Set attributes and operation signatures for interfaces. Use either import or export relationship in b/w interfaces & components. Identify the source code which is interacting with the system. Set the version of the source code as a constraint to each source code. Represent source code as components.
Page | 32

2. 3. 4. 5. 6. 7. 8. 9. 10. 11. 12. 13.

UNIFIED MODELING LANGUAGE

14. 15.

Show the relationships among components. Adorn with nodes, constraints and tag values.

Modeling steps for Deployment Diagram:


1. 2. 3. 4. 5. 6. 7.

Identify the processors which represent client & server. Provide the visual cue via stereotype classes. Group all the similar clients into one package. Provide the links among clients & servers. Provide the attributes & operations. Specify the components which are living on nodes. Adorn with nodes & constraints & draw the deployment diagram.

CLASS DIAGRAM:
A Class is a standard UML construct used to detail the pattern from which objects will be produced at run time. A class is a specification- an object is an instance of a class. Classes may be inherited from other classes, have other classes as attributes, delegate responsibilities to other classes and implement abstract interfaces. The class diagram for the proposed system has several classes. These classes have attributes and operations. The description for each of them is described clearly. The classes include

Book shop staff Book Bookshop Item Customer Shopping cart Order Item order Shipping address and billing address.

UNIFIED MODELING LANGUAGE

Page | 33

PACKAGES:
The class diagram of the online book shop system is shown to be grouped into three packages. The contents of the packages are as follows:

PACKAGE-1: BOOKSHOP
This package consists of following classes: 1. Bookshop staff 2. Book 3. Bookshop 4. Item

PACKAGE-2: CUSTOMER
This package consists of following classes:
1. 2. 3. 4.

Customer Address Billing Address Shipping Address

PACKAGE -3: ONLINE ORDERING


This package consists of following classes:
1. 2. 3.

Order Item Order Shopping Cart

CLASS DIAGRAM:

UNIFIED MODELING LANGUAGE

Page | 34

USE CASE DIAGRAM FOR ONLINE BOOKSHOP SYSTEM:

SEQUENCE DIAGRAM:

UNIFIED MODELING LANGUAGE

Page | 35

UML provides a graphical means of depicting object interactions over time in sequence diagrams. These typically show a user or actor and the objects and components they interact with in the execution of a use case.

COLLOBORATION DIAGRAM:
Collaboration names a society of classes, interfaces and other elements that work together to provide some cooperative behavior that is bigger than the sum of all its parts. Collaboration diagram emphasis is based on structural organization of the objects that send and receive messages.

STATE CHART DIAGRAM:


Objects have behaviors and state. The state of an object depends on its current activity or condition. A state chart diagram shows the possible states of the object and the transitions that cause a change in state. The initial state (black circle) is a dummy to start the action. Final states are also dummy states that terminate the action.

ACTIVITY DIAGRAM:
An activity diagram is essentially a fancy flowchart. Activity diagrams and state chart diagrams are related. While a state chart diagram focuses attention on an object undergoing a process (or on a process as an object), an activity diagram focuses on the flow of activities involved in a single process. The activity diagram shows the how those activities depend on one
UNIFIED MODELING LANGUAGE Page | 36

another. Activity diagrams can be divided into object swim lanes that determine which object is responsible for which activity. A single transaction comes out of each activity, connecting it to the next activity.

COMPONENT DIAGRAM:
A component is a code module. Component diagrams are physical analogs of class diagram. Each component belongs on a node. Components are shown as rectangles with two tabs at the upper left.

DEPLOYMENT DIAGRAM:
Deployment diagram shows the physical configurations of software and hardware.

UNIFIED MODELING LANGUAGE

Page | 37

RESULT:
Thus various UML Diagrams were generated for ONLINE BOOK SHOP and the corresponding code was generated using Visual Basic.

UNIFIED MODELING LANGUAGE

Page | 38

S-ar putea să vă placă și