CS2357 OOAD LAB OBJECTIVE: To develop a mini-project following the 12 exercises listed below. 1.

To develop a problem statement. 2. Develop an IEEE standard SRS document. Also develop risk management and project plan (Gantt chart). 3. Identify Use Cases and develop the Use Case model. 4. Identify the business activities and develop an UML Activity diagram. 5. Identity the conceptual classes and develop a domain model with UML Class diagram. 6. Using the identified scenarios find the interaction between objects and represent them using UML Interaction diagrams. 7. Draw the State Chart diagram. 8. Identify the User Interface, Domain objects, and Technical services. Draw the partial layered, logical architecture diagram with UML package diagram notation. 9. Implement the Technical services layer. 10. Implement the Domain objects layer. 11. Implement the User Interface layer. 12. Draw Component and Deployment diagrams. Suggested domains for Mini-project. 1. Passport automation system. 2. Book bank 3. Exam Registration 4. Stock maintenance system. 5. Online course reservation system 6. E-ticketing 7. Software personnel management system 8. Credit card processing 9. e-book management system 10. Recruitment system 11. Foreign trading system 12. Conference Management System 13. BPO Management System

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. 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 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 by sending each other messages. Think of an

AN INTRODUCTION TO UML DIAGRAM The Unified Modeling Language is a language for specifying. Analogous to the use of architectural blueprints in the construction industry. the users who interact with the system (actors). Use Cases are used in the Analysis phase of software development to articulate the high-level requirements of the system. is a user of the system. and the Association. ACTOR An Actor. Classes are the "blueprints" for objects." Objects have things they know (attributes) and things they can do (behaviors or operations).object as "alive. The role of the user is written beneath the icon. The values of an object's attributes determine its state. and is depicted using a stick figure. and documenting the artifacts of a software-intensive system. . UML provides a common language for describing software models. USE CASE DIAGRAM Use Case diagrams identify the functionality provided by the system (use cases). GRAPHICAL NOTATION The basic components of Use Case diagrams are the Actor. and the association between the users and the functionality. the Use Case. and it can be used in conjunction with a wide range of software lifecycles and development processes. Objects are instances of classes. constructing. 1. The primary goals of Use Case diagrams include:  Providing a high-level view of what the system does  Identifying the users ("actors") of the system  Determining areas needing human-computer interfaces. visualizing. as mentioned. A class wraps attributes (data) and behaviors (methods or functions) into a single distinct entity. Actors are not limited to humans.

Use Cases are depicted with an ellipse. The name of the use case is written within the ellipse. then that application can also be considered an actor. and expects input or delivers output. . The following image shows how these three basic elements work together to form a use case diagram. Delete User).If a system communicates with another application. The emphasis is on what a system does rather than how.g. typically described as verb + object (e. ASSOCIATION Associations are used to link Actors with Use Cases. Register Car. USE CASE A Use Case is functionality provided by the system. Use case diagrams describe what a system does from the standpoint of an external observer. Associations are depicted by a line connecting the Actor and the Use Case. and indicate that an Actor participates in the Use Case in some form.

such as a use case. Because UML is designed for object-oriented programming. New use cases often generate new requirements as the system is analyzed and the design takes shape.Use case diagrams are helpful in three areas. classes and actors are listed as columns. and are arranged horizontally. Generating test cases. and models these messages over time. The Sequence diagram lists objects horizontally. • • 2. . Communicating with clients. NOTATION In a Sequence diagram. Their notational simplicity makes use case diagrams a good way for developers to communicate with clients. these communications between classes are known as messages. SEQUENCE DIAGRAM Sequence diagrams document the interactions between classes to achieve a result. The pictorial representation for an Object is a class (a rectangle) with the name prefixed by the object name (optional) and a semi-colon. • Determining features (requirements). OBJECT Objects are instances of classes. with vertical lifelines indicating the lifetime of the object over time. The collection of scenarios for a use case may suggest a suite of test cases for those scenarios. and time vertically.

The object initiating the sequence of messages is a Reservation window. LIFELINE The Lifeline identifies the existence of the object over time. An Actor is modeled using the ubiquitous symbol. Below is a sequence diagram for making a hotel reservation. indicate the communications between objects. so they too can be listed as a column. ACTIVATION Activations. modeled as rectangular boxes on the lifeline. the stick figure. indicate when the object is performing an action. MESSAGE Messages. The notation for a Lifeline is a vertical dotted line extending from an object. modeled as horizontal arrows between Activations. .ACTOR Actors can also communicate with objects.

external events. If the Hotel has available rooms. representing the time that an object exists. ACTIVITY DIAGRAM Activity diagrams are used to document workflows in a system. In fact. Each vertical dotted line is a lifeline. you'll notice elements from State diagrams. 3. When looking at an Activity diagram. An arrow goes from the sender to the top of the activation bar of the message on the receiver's lifeline. and the transitions represent the activities that happen when the operation is complete. the Activity diagram is a variation of the state diagram where the "states" represent operations. then it makes a Reservation and a Confirmation. The HotelChain then sends a makeReservation() message to a Hotel. The activation bar represents the duration of execution of the message. Each arrow is a message call. from the business level down to the operational level. The general purpose of Activity diagrams is to focus on flows driven by internal processing vs.The Reservation window sends a makeReservation() message to a HotelChain. .

Transitions are modeled using arrows.ACTIVITY STATES Activity states mark an action by an object. Transitions are used to mark this movement. and vertical bars separate the columns to form the swim lanes. and these states are modeled using a solid circle surrounded by another circle. SWIM LANE Swim lanes divide activities according to objects by arranging objects in column format and placing activities by that object within that column. a solid circle. FINAL STATE Final States mark the end of the modeled workflow. There can only be one Initial State on a diagram. . The notation for the Initial State is the same as in State chart diagrams. TRANSITION When an Activity State is completed. processing moves to another Activity State. the same notation as found in State chart diagrams. There can be multiple Final States on a diagram. INITIAL STATE The Initial State marks the entry point and the initial Activity State. The notations for these states are rounded rectangles. Objects are listed at the top of the column.

pointing from a component to the component it depends on. is used to describe the dependencies between various software components such as the dependency between executable files and source files. The notation for a dependency relationship is a dotted arrow. To split processing ("fork"). which describe source code dependencies and can be used to properly compile an application. . with two rectangles protruding from the left side. Synchronization Bars are used. 4. A Component Diagram. COMPONENT DIAGRAM Component diagrams fall under the category of an implementation diagram. as seen in the image to the right. a kind of diagram that models the implementation and deployment of the system.SYNCHRONIZATION BAR Activities often can be done in parallel. and resource files. with multiple transitions going in and/or out. This information is similar to that within make files. A component is represented using a rectangular box. in particular. Examples include source code files. programs. documents. DEPENDENCY A Dependency is used to model the relationship between two components. These are modeled as solid rectangles. COMPONENT A component represents a software entity in a system. or to resume processing when multiple activities have been completed ("join").


A Payment is one of three kinds: Cash. . are in italics. Relationships between classes are the connecting links. The class diagram below models a customer order from a retail catalog. The central class is the Order. Check. Names of abstract classes. or Credit. UML class notation is a rectangle divided into three parts: class name. Class diagrams are static -. such as Payment. each with its associated Item. In a diagram. and operations. attributes.5.a relationship between instances of the two classes. CLASS DIAGRAM A Class diagram gives an overview of a system by showing its classes and the relationships among them. The order contains OrderDetails (line items). There is an association between two classes if an instance of one class must know about the other in order to perform its work.they display what interacts but not what happens when they do interact. Associated with it are the Customer making the purchase and the Payment. an association is a link connecting two classes. Our class diagram has three kinds of relationships. • association -.

Multiplicities are single numbers or ranges of numbers. A generalization has a triangle pointing to the superclass. and multiplicities. • generalization -.1 0. . Multiplicities 0. m indicates n to m instances. The notation n .* or * 1 1.. in this case. An end may have a role name to clarify the nature of the association. OrderDetail has an Item..an association in which one class belongs to a collection.an inheritance link indicating one class is a superclass of the other. Associations with no navigability arrows are bidirectional. associations. Check. there can be only one Customer for each Order. no limit on the number of instances (including none). . An aggregation has a diamond end pointing to the part containing the whole. Payment is a superclass of Cash. The multiplicity of an association end is the number of possible instances of the class associated with a single instance of the other end. exactly one instance at least one instance has classes.• aggregation -. and Credit. Navigability and roles are optional items placed in a diagram to provide clarity. but not the other way around. In our example.* Every class diagram Meaning zero or one instance. but a Customer can have any number of Orders. An OrderDetail can be queried about its Item. In our diagram. For example.. Order has a collection of OrderDetails. The arrow also lets you know who "owns" the association's implementation. An association has two ends. an OrderDetail is a line item of each Order. This table gives the most common multiplicities. A navigability arrow on an association shows which direction the association can be traversed or queried.

especially recursive relationships. PACKAGES AND OBJECT DIAGRAMS To simplify complex class diagrams. One package depends on another if changes in the other could possibly force changes in the first. They are useful for explaining small pieces with complicated relationships. This small class diagram shows that a university Department can contain lots of other Departments. The diagram below is a business model in which the classes are grouped into packages. A package is a collection of logically related UML elements. . The dotted arrows are dependencies. you can group classes into packages. Packages appear as rectangles with small tabs at the top. The package name is on the tab or inside the rectangle.6. Object diagrams show instances instead of classes.

In a sequence diagram. Each rectangle in the object diagram corresponds to a single instance. object roles are the vertices and messages are the connecting links. They convey the same information as sequence diagrams. . replacing it by a concrete example.The object diagram below instantiates the class diagram. Instance names are underlined in UML diagrams. 7. but they focus on object roles instead of the times that messages are sent. Class or instance names may be omitted from object diagrams as long as the diagram meaning is still clear. COLLABORATION DIAGRAMS Collaboration diagrams are also interaction diagrams.

STATE CHART DIAGRAMS Objects have behaviors and state. A statechart diagram shows the possible states of the object and the transitions that cause a change in state. Validating. Our example diagram models the login part of an online banking system. and Rejecting. 8. Logging in can be factored into four non-overlapping states: Getting SSN. Class names are preceded by colons ( : ). From each state comes a complete set of transitions that determine the subsequent state. . according to when they occur.The object-role rectangles are labeled with either class or object names (or both). etc. Messages at the same level (sent during the same call) have the same decimal prefix but suffixes of 1. The top-level message is numbered 1. 2. Logging in consists of entering a valid social security number and personal id number. The state of an object depends on its current activity or condition. Getting PIN. Each message in a collaboration diagram has a sequence number. then submitting the information for validation.

The following deployment diagram shows the relationships among software and hardware components involved in real estate transactions. The initial state (black circle) is a dummy to start the action. one on Getting SSN and another on Getting PIN. Events or conditions that trigger transitions are written beside the arrows. COMPONENT AND DEPLOYMENT DIAGRAMS A component is a code module. Final states are also dummy states that terminate the action. 9. Deployment diagrams show the physical configurations of software and hardware. . Component diagrams are physical analogs of class diagram. Transitions are arrows from one state to another. Our diagram has two self-transition.States are rounded rectangles.

and so forth. an application logic (or "domain") layer. Each component belongs on a node. Components are shown as rectangles with two tabs at the upper left.The physical hardware is made up of nodes. As we have finished the requirement analysis part of the first iteration and are ready to move on to design we can look at a larger scale. Logical Architecture and UML Package Diagrams • • • The software architecture is a fairly large topic: we will only introduce one possible solution (the most common) here. . The design of a typical OO system is based on several architectural layers. such as a UI layer.

Logical architecture using a UML package diagram. .

Designing with Layers . and so on. for example. use cases. A UML package represents a namespace so that. java::util::Date in the case that there was an outer package named "java" with a nested package named "util" with a Date class. for example. the UML notation is. If you need to provide fully-qualified names. Nesting packages is very common. A UML package can group anything: classes. a Date class may be defined in two packages. other packages. It is common to want to show dependency (a coupling) between packages so that developers can see the large-scale coupling in the system.• • • A UML package diagram provides a way to group elements.

And on the other hand. For example. change color. Objects in the application logic or "domain" layer should focus on application logic. for example. application logic classes should not trap UI mouse or keyboard events. • . objects in the UI layer should focus on UI work. capturing mouse and keyboard events. a Java Swing JFrame (window) object should not contain logic to calculate taxes or move a game piece. and so forth. and so forth. That would violate a clear separation of concerns and maintaining high cohesion : basic architectural principles. such as calculating a sales total or taxes. So. For example. The Model-View Separation Principle • The Model-View Separation principle states that model (domain) objects should not have direct knowledge of view (UI) objects. close. a Register or Sale object should not directly send a message to a GUI window object ProcessSaleFrame. such as creating windows and widgets. or moving a piece on a game board. – UI objects should not do application logic. asking it to display something.Guidelines – The responsibilities of the objects in a layer should be strongly related to each other and should not be mixed with responsibilities of other layers.

Sign up to vote on this title
UsefulNot useful