Srs
- 2. Agenda
• SRS Session
• Resources available in TGMC DVD kit
• Installation of all software's
• Small Application development
© 2011 IBM Corporation
- 3. 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
- 4. SRS Session
• Tools and Technologies
• Sample SRS
© 2011 IBM Corporation
- 5. Classes
A class is a description of a set of
ClassName objects that share the same attributes,
operations, relationships, and semantics.
attributes
Graphically, a class is rendered as a
rectangle, usually including its name,
operations attributes, and operations in separate,
designated compartments.
© 2011 IBM Corporation
- 6. Class Names
The name of the class is the only required
ClassName tag in the graphical representation of a
class. It always appears in the top-most
attributes compartment.
operations
© 2011 IBM Corporation
- 7. Class Attributes
Person
name : String An attribute is a named property of a
address : Address class that describes the object being modeled.
birthdate : Date In the class diagram, attributes appear in
ssn : Id the second compartment just below the
name-compartment.
© 2011 IBM Corporation
- 8. Class Attributes (Cont’d)
Attributes are usually listed in the form:
Person attributeName : Type
name : String A derived attribute is one that can be
address : Address computed from other attributes, but
birthdate : Date doesn’t actually exist. For example,
/ age : Date a Person’s age can be computed from
ssn : Id his birth date. A derived attribute is
designated by a preceding ‘/’ as in:
/ age : Date
© 2011 IBM Corporation
- 9. Class Attributes (Cont’d)
Person
Attributes can be:
+ name : String
+ public
# address : Address
# protected
# birthdate : Date
- private
/ age : Date
/ derived
- ssn : Id
© 2011 IBM Corporation
- 10. Class Operations
Person
name : String
address : Address
birthdate : Date
ssn : Id
eat Operations describe the class behavior
sleep and appear in the third compartment.
work
play
© 2011 IBM Corporation
- 11. Class Operations (Cont’d)
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
- 12. Depicting Classes
When drawing a class, you needn’t show attributes and operation
in every diagram.
Person Person Person
name : String
birthdate : Date
Person ssn : Id
name Person eat()
address sleep()
birthdate eat work()
play play()
© 2011 IBM Corporation
- 13. 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
- 14. 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
- 15. 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
- 16. Generalization Relationships (Cont’d)
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
- 17. 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
- 18. Association Relationships (Cont’d)
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
- 20. Association Relationships (Cont’d)
We can also indicate the behavior of an object in an association
(i.e., the role of an object) using rolenames.
teaches learns from
Student Instructor
1..* 1..*
© 2011 IBM Corporation
- 23. Interfaces
An interface is a named set of
operations that specifies the behavior
<<interface>> of objects without showing their inner
ControlPanel 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
- 24. Interface Services
<<interface>> They specify the services offered
ControlPanel by a related class.
getChoices : Choice[]
makeChoice (c : Choice)
getSelection : Selection
© 2011 IBM Corporation
- 25. Interface Realization Relationship
A realization relationship
<<interface>>
connects a class with an
ControlPanel
interface that supplies its
specifier behavioral specification. It is
rendered by a dashed line with
a hollow triangle towards the
specifier.
implementation
VendingMachine
© 2011 IBM Corporation
- 26. Enumeration
<<enumeration>> An enumeration is a user-defined
Boolean data type that consists of a name and
false an ordered list of enumeration
true literals.
© 2011 IBM Corporation
- 27. Exceptions
<<exception>> Exceptions can be modeled
Exception just like any other class.
getMessage() Notice the <<exception>>
printStackTrace() stereotype in the name
compartment.
<<exception>> <<exception>>
KeyException SQLException
© 2011 IBM Corporation
- 28. 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
- 29. Use Case (Cont’d)
A use case is rendered as an ellipse
Register for Courses
in a use case diagram. A use case is
always labeled with its name.
© 2011 IBM Corporation
- 30. Use Case (Cont’d)
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
- 31. Use Case (Cont’d)
Actors can participate in a generalization relation with other
actors.
Student Person
© 2011 IBM Corporation
- 32. Use Case (Cont’d)
Actors may be connected to use cases
only by associations.
Register for Courses
Student
© 2011 IBM Corporation
- 33. Use Case (Cont’d)
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
- 34. 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
- 35. State Machine
download course offerings downloading
unscheduled
make a course selection
selecting
make a different selection verify selection
verifying
select another course
check schedule
sign schedule
checking schedule
scheduled
© 2011 IBM Corporation
- 36. 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
- 37. 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
- 38. Sequence Diagram
an Order Line a Stock Item
Messages are rendered as horizontal
check() arrows being passed from object to
[check = “true”] object as time advances down the
remove()
object lifelines. Conditions ( such as
[check = “true”] ) indicate when a
message gets passed.
© 2011 IBM Corporation
- 39. Sequence Diagram
an Order Line a Stock Item
check()
[check = “true”]
Notice that the bottom arrow is different.
remove() 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
- 40. Sequence Diagram
an Order a Order Line
* prepare()
An iteration marker, such as * (as
shown), or *[i = 1..n] , indicates
that a message will be repeated as
Iteration indicated.
marker
© 2011 IBM Corporation
- 41. an Order Entry
window
an Order an Order Line a Stock Item [Fowler,97]
prepare()
Condition
* prepare()
Object
check()
Message [check = “true”]
remove() needsToReorder()
Iteration
Self-Delegation
Return
[needsToReorder = “true”]
new
A Reorder
Item
[check = “true”]
A Delivery
new
Item
Creation
© 2011 IBM Corporation
- 42. Sequence Diagram – Compilation
:Compiler Linker FileSystem
Actor
Compile Load Files
Compile files
Save OBJ Files
Link
Load OBJ files
Link OBJ files
Write EXE file
42 © 2011 IBM Corporation
- 43. Alternative Flow: flow changes to alternative lifeline branch
of the same object
Editor FileSystem
Actor
Exit App
[delete file]
[save file]
43 © 2011 IBM Corporation
- 44. 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
- 45. Receive
Order [Fowler,97]
Multiple Trigger
for each line
* item on order
Check
Cancel Authorize
Line
Order Payment
[failed] Item
[succeeded] [in stock]
Assign to
Order
Synchronization Condition
[need to
reorder] Reorder
Item
[stock assigned to
all line items and
payment authorized]
Dispatch
Order
© 2011 IBM Corporation
- 47. 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
- 48. 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
- 49. 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
- 50. 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
- 51. 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
- 52. 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
- 53. 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
- 54. 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
- 55. ER Diagram Components
Every entity diagram consists of the
following components:
Entity (labelled box) Course
Relationship line
© 2011 IBM Corporation
- 56. Degrees of a Relationship
One-to-one (1:1)
1 1
Man Woman
One-to-many (1:n)
1 M
Customer Order
Many-to-many (n:m)
M M
Course Subject
NOTE: Every many to many relationship consists of two one to
many relationships working in opposite directions
© 2011 IBM Corporation
- 57. Degrees of relationship, alternative
representation
One-to-one (1:1)
Man Woman
One-to-many (1:n)
Customer Order
Many-to-many (n:m)
Course Subject
NOTE: Every many to many relationship consists of two one to
many relationships working in opposite directions
© 2011 IBM Corporation
- 58. Notation for optional attributes
1 M
Person Car
A person must own at least one car. A car
doesn’t have to be owned by a person, but if
it is, it is owned 1 at least one person. A
by
person may own many cars.
optional relationship mandatory relationship
© 2011 IBM Corporation
- 59. A Sample ER Diagram
Student
Course Subject
A Student Record Entity Diagram
© 2011 IBM Corporation
- 60. 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
- 62. 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
- 63. 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