Vous êtes sur la page 1sur 63

Information Management Software Information Management Software

TGMC Technical Session Bringing it All Together!

Click to add text

2011 IBM Corporation

Agenda
SRS Session Resources available in TGMC DVD kit Installation of all software's Small Application development

2011 IBM Corporation

SRS Session
SRS Format Structural Diagrams Class Diagram Behavioral Diagrams Sequence diagram Use case model Activity diagram Database Diagrams ER diagram Schema diagram
2011 IBM Corporation

SRS Session
Tools and Technologies Sample SRS

2011 IBM Corporation

Classes
A class is a description of a set of objects that share the same attributes, operations, relationships, and semantics. Graphically, a class is rendered as a rectangle, usually including its name, attributes, and operations in separate, designated compartments.

ClassName attributes operations

2011 IBM Corporation

Class Names

ClassName attributes operations

The name of the class is the only required tag in the graphical representation of a class. It always appears in the top-most compartment.

2011 IBM Corporation

Class Attributes

Person name : String address : Address birthdate : Date ssn : Id An attribute is a named property of a class that describes the object being modeled. In the class diagram, attributes appear in the second compartment just below the name-compartment.

2011 IBM Corporation

Class Attributes (Contd)


Attributes are usually listed in the form: Person name : String address : Address birthdate : Date / age : Date ssn : Id attributeName : Type A derived attribute is one that can be computed from other attributes, but doesnt actually exist. For example, a Persons age can be computed from his birth date. A derived attribute is designated by a preceding / as in: / age : Date

2011 IBM Corporation

Class Attributes (Contd)

Person + name : String # address : Address # birthdate : Date / age : Date - ssn : Id Attributes can be: + public # protected - private / derived

2011 IBM Corporation

Class Operations

Person name : String address : Address birthdate : Date ssn : Id eat sleep work play Operations describe the class behavior and appear in the third compartment.

2011 IBM Corporation

Class Operations (Contd)

PhoneBook newEntry (n : Name, a : Address, p : PhoneNumber, d : Description) getPhone ( n : Name, a : Address) : PhoneNumber

You can specify an operation by stating its signature: listing the name, type, and default value of all parameters, and, in the case of functions, a return type.

2011 IBM Corporation

Depicting Classes
When drawing a class, you neednt show attributes and operation in every diagram. Person Person Person name : String birthdate : Date ssn : Id Person eat play eat() sleep() work() play()

Person name address birthdate

2011 IBM Corporation

Relationships

In UML, object interconnections (logical or physical), are modeled as relationships. There are three kinds of relationships in UML: dependencies generalizations associations

2011 IBM Corporation

Dependency Relationships
A dependency indicates a semantic relationship between two or more elements. The dependency from CourseSchedule to Course exists because Course is used in both the add and remove operations of CourseSchedule.

CourseSchedule Course add(c : Course) remove(c : Course)

2011 IBM Corporation

Generalization Relationships

Person A generalization connects a subclass to its superclass. It denotes an inheritance of attributes and behavior from the superclass to the subclass and indicates a specialization in the subclass of the more general superclass. Student

2011 IBM Corporation

Generalization Relationships (Contd)


UML permits a class to inherit from multiple superclasses, although some programming languages (e.g., Java) do not permit multiple inheritance. Student Employee

TeachingAssistant

2011 IBM Corporation

Association Relationships
If two classes in a model need to communicate with each other, there must be link between them. An association denotes that link.

Student

Instructor

2011 IBM Corporation

Association Relationships (Contd)


We can indicate the multiplicity of an association by adding multiplicity adornments to the line denoting the association. The example indicates that a Student has one or more Instructors: Student Instructor

1..*

2011 IBM Corporation

Association Relationships (Contd)

The example indicates that every Instructor has one or more Students:

Student

1..*

Instructor

2011 IBM Corporation

Association Relationships (Contd)


We can also indicate the behavior of an object in an association (i.e., the role of an object) using rolenames.

Student

teaches 1..*

learns from 1..*

Instructor

2011 IBM Corporation

Association Relationships (Contd)


We can also name the association.

Student

membership 1..* 1..*

Team

2011 IBM Corporation

Association Relationships (Contd)


We can specify dual associations.

member of Student 1..*


1

1..* president of 1..*

Team

2011 IBM Corporation

Interfaces

<<interface>> ControlPanel

An interface is a named set of operations that specifies the behavior of objects without showing their inner structure. It can be rendered in the model by a one- or two-compartment rectangle, with the stereotype <<interface>> above the interface name.

2011 IBM Corporation

Interface Services

<<interface>> ControlPanel getChoices : Choice[] makeChoice (c : Choice) getSelection : Selection

They specify the services offered by a related class.

2011 IBM Corporation

Interface Realization Relationship

<<interface>> ControlPanel
specifier

implementation

A realization relationship connects a class with an interface that supplies its behavioral specification. It is rendered by a dashed line with a hollow triangle towards the specifier.

VendingMachine

2011 IBM Corporation

Enumeration

<<enumeration>> Boolean false true

An enumeration is a user-defined data type that consists of a name and an ordered list of enumeration literals.

2011 IBM Corporation

Exceptions

<<exception>> Exception getMessage() printStackTrace()

Exceptions can be modeled just like any other class. Notice the <<exception>> stereotype in the name compartment.

<<exception>> KeyException

<<exception>> SQLException

2011 IBM Corporation

Use Case
A use case specifies the behavior of a system or a part of a system, and is a description of a set of sequences of actions, including variants, that a system performs to yield an observable result of value to an actor. - The UML User Guide, [Booch,99] An actor is an idealization of an external person, process, or thing interacting with a system, subsystem, or class. An actor characterizes the interactions that outside users may have with the system. - The UML Reference Manual, [Rumbaugh,99]

2011 IBM Corporation

Use Case (Contd)

Register for Courses

A use case is rendered as an ellipse in a use case diagram. A use case is always labeled with its name.

2011 IBM Corporation

Use Case (Contd)

An actor is rendered as a stick figure in a use case diagram. Each actor participates in one or more use cases.

Student

2011 IBM Corporation

Use Case (Contd)


Actors can participate in a generalization relation with other actors.

Student

Person

2011 IBM Corporation

Use Case (Contd)

Actors may be connected to use cases only by associations.

Register for Courses

Student

2011 IBM Corporation

Use Case (Contd)


Here we have a Student interacting with the Registrar and the Billing System via a Register for Courses use case.

Billing System

Student

Register for Courses

Registrar

2011 IBM Corporation

State Machine
An object must be in some specific state at any given time during its lifecycle. An object transitions from one state to another as the result of some event that affects it. You may create a state diagram for any class, collaboration, operation, or use case in a UML model . There can be only one start state in a state diagram, but there may be many intermediate and final states.

2011 IBM Corporation

State Machine
download course offerings unscheduled make a course selection selecting downloading

make a different selection

verify selection verifying select another course

check schedule sign schedule scheduled checking schedule

2011 IBM Corporation

Sequence Diagram

A sequence diagram is an interaction diagram that emphasizes the time ordering of messages. It shows a set of objects and the messages sent and received by those objects.

- The UML User Guide, [Booch,99]

2011 IBM Corporation

Sequence Diagram
an Order Line

An object in a sequence diagram is rendered as a box with a dashed line descending from it. The line is called the object lifeline, and it represents the existence of an object over a period of time.

2011 IBM Corporation

Sequence Diagram
an Order Line a Stock Item

Messages are rendered as horizontal


check() [check = true] remove()

arrows being passed from object to object as time advances down the object lifelines. Conditions ( such as [check = true] ) indicate when a message gets passed.

2011 IBM Corporation

Sequence Diagram
an Order Line a Stock Item

check() [check = true] remove()

Notice that the bottom arrow is different. The arrow head is not solid, and there is no accompanying message.

This arrow indicates a return from a previous message, not a new message.

2011 IBM Corporation

Sequence Diagram
an Order a Order Line

* prepare()

Iteration marker

An iteration marker, such as * (as shown), or *[i = 1..n] , indicates that a message will be repeated as indicated.

2011 IBM Corporation

an Order Entry window prepare()

an Order

an Order Line

a Stock Item

[Fowler,97]
Condition

* prepare()

Object Message Iteration

check() [check = true] remove()

needsToReorder()

Return

Self-Delegation
[needsToReorder = true] new A Reorder Item

[check = true] new

A Delivery Item

Creation

2011 IBM Corporation

Sequence Diagram Compilation


:Compiler Actor
Compile Load Files

Linker

FileSystem

Compile files
Save OBJ Files Link Load OBJ files

Link OBJ files


Write EXE file

42

2011 IBM Corporation

Alternative Flow: flow changes to alternative lifeline branch of the same object Editor Actor
Exit App

FileSystem

[delete file]

[save file]

43

2011 IBM Corporation

Activity Diagram
An activity diagram is essentially a flowchart, showing the flow of control from activity to activity. Use activity diagrams to specify, construct, and document the dynamics of a society of objects, or to model the flow of control of an operation. Whereas interaction diagrams emphasize the flow of control from object to object, activity diagrams emphasize the flow of control from activity to activity. An activity is an ongoing non-atomic execution within a state machine. - The UML User Guide, [Booch,99]

2011 IBM Corporation

Receive Order

[Fowler,97]
Multiple Trigger
for each line item on order

*
Cancel Order
[failed]

Authorize Payment
[succeeded]

Check Line Item


[in stock]

Assign to Order Synchronization Condition


[need to reorder] [stock assigned to all line items and payment authorized]

Reorder Item

Dispatch Order

2011 IBM Corporation

Database Diagrams

2011 IBM Corporation

Introduction
Entity Relationship Modeling (ERM) a technique used to analyze & model the data in organizations using an Entity Relationship (E-R) diagram.

2011 IBM Corporation

Definitions
Entity an aggregation of a number of data elements each data element is an attribute of the entity Entity type a class of entities with the same attributes Relationship an association between two or more entities that is of particular interest

2011 IBM Corporation

ERD Development Process


Identify the entities Determine the attributes for each entity Select the primary key for each entity Establish the relationships between the entities Draw an entity model Test the relationships and the keys

2011 IBM Corporation

A Simple Example

STUDENTs attend COURSEs that consist of many SUBJECTs. A single SUBJECT (i.e. English) can be studied in many different COURSEs. Each STUDENT may only attend one COURSE.

2011 IBM Corporation

Identify the entities


Any entity can be classified in one of the following categories: Regular : any physical object, event, or abstract concept that we can record facts about. Weak : any entity that depends on another entity for its existence.

2011 IBM Corporation

Determine the Attributes


Every Entity has attributes. Attributes are characteristics that allow us to classify/describe an entity e.g., entity STUDENT has the attributes:

student number name date of birth course number

2011 IBM Corporation

Key Attributes
Certain attributes identify particular facts within an entity, these are known as KEY attributes.

The different types of KEY attribute are: Primary Key


Composite Primary Key

Foreign Key

2011 IBM Corporation

Key Definitions
Primary Key: One attribute whose value can uniquely identify a complete record (one row of data) within an entity. Composite Primary Key A primary key that consists of two or more attribute within an entity. Foreign Key A copy of a primary key that exists in another entity for the purpose of forming a relationship between the entities involved.

2011 IBM Corporation

ER Diagram Components

Every entity diagram consists of the following components:


Entity (labelled box)

Course

Relationship line

2011 IBM Corporation

Degrees of a Relationship
One-to-one (1:1)

Man
One-to-many (1:n)

Woman

Customer
Many-to-many (n:m)

Order

Course

Subject

NOTE: Every many to many relationship consists of two one to many relationships working in opposite directions
2011 IBM Corporation

Degrees of relationship, alternative representation


One-to-one (1:1)

Man
One-to-many (1:n)

Woman

Customer
Many-to-many (n:m)

Order

Course

Subject

NOTE: Every many to many relationship consists of two one to many relationships working in opposite directions
2011 IBM Corporation

Notation for optional attributes


Person 1 M Car

A person must own at least one car. A car doesnt have to be owned by a person, but if it is, it is owned 1 by at least one person. A person may own many cars.

optional relationship

mandatory relationship
2011 IBM Corporation

A Sample ER Diagram
Student

Course

Subject

A Student Record Entity Diagram

2011 IBM Corporation

Summary of ER Diagram Designing

Identify the entities Determine the attributes for each entity Select the primary key for each entity Establish the relationships between the entities Draw an entity model
2011 IBM Corporation

Tools and Technologies


See Technical Resources page on TGMC website

2011 IBM Corporation

Best of Luck

For TGMC contest and Technical queries: tgmc@in.ibm.com For SRS submission: Save your SRS in PDF format.

2011 IBM Corporation

Best of Luck
Ask your faculty mentor to register at www.ibm.com/in/university
For all the softwares and e-Books download

2011 IBM Corporation

Vous aimerez peut-être aussi