case study in analysis: a library information system
TRANSCRIPT
Case Study in Analysis: A library information system
Use case Make Book Entry Use Case: UC1 - Make Book Entry Actor: Library clerk Success scenario:
• A library clerk accesses a terminal in order to enter one or possibly many book entries in a database. At the end of every entry, the system displays a confirmation message. At the end of the session the system would display an informative message.
SSD for Make Book Entrysuccess scenario
confirmation
endBookEntry()
confirmation
addBook(author, title, publisher, year)
makeNewBookEntry()
:Library Clerk:System
loop
Naming System Events and Operations
The set of all required system operations is determined by identifying the system events.• makeNewBookEntry()
• addBook()
• endBookEntry()
Domain model conclusion
TerminalLibrary Clerk
Catalog
Book Entry
Book
authortitlepublisheryear
Accesses Captures
Accesses
Contained-in
1 1 1 *
1
1
1*
System operations andthe system interface
In the UML the system as a whole can be represented as a class.
Contracts are written for each system operation to describe its behavior.
System
makeNewBookEntry()addBook()endBookEntry()
Operation contract: makeNewBookEntry
Contract CO1: makeNewBookEntry
Operation: makeNewBookEntry()
Cross References: Use case Make Book Entry.
Pre-conditions: None.
Post-conditions: 1. an instance of Book Entry be was
created. (instance creation)
2. be was associated with Terminal
(formation of association)
3. be was associated with Catalog
(formation of association)
Operation contract: addBook
Contract CO2: addBook
Operation: addBook(author, title, publisher, year)
Cross References: Use case Make Book Entry.
Pre-conditions: A Book Entry session is under way.
Post-conditions: 1. an instance of Book b was created
(instance creation).
2. b was associated with Catalog
(formation of association)
Operation contract: endBookEntry
Contract CO3: endBookEntry
Operation: endBookEntry()
Cross References: Use case Make Book Entry.
Pre-conditions: A Book Entry session is under way.
Post-conditions: BookEntry.isComplete was set to true.
(modification of attribute)
Object design: makeNewBookEntryContract CO1: makeNewBookEntry…Post-conditions: 1. an instance of Book Entry be was created. (instance
creation)2. be was associated with Terminal (formation of association)3. be was associated with Catalog (formation of association)
makeNewBookEntry():Book Entry
1: create():Terminal
:Catalog
Object design: addBookContract CO2: addBook…Post-conditions: 1. an instance of Book b was created (instance
creation).2. b was associated with Catalog (formation of association)
addBook(…)
b: Book
1: makeNewBook(…)
2.1: create (…)2.2: add (b)
:Terminal :BookEntry
2: makeNewBook(…)
:Book
:Catalog
Object design: endBookEntryContract CO3: endBookEntry…Post-conditions: BookEntry.isComplete was set to true.
(modification of attribute)
endBookEntry()
be:BookEntry1: becomeComplete()
public void becomeComplete() {isComplete = true;
}
UML notation for a constraint
{be.isComplete = true}
:Terminal
Class diagram conclusion
Library ClerkAccesses Captures
1 1 1 *
1
BookEntry
makeNewBook()becomeComplete()
isComplete: Boolean
Terminal
makeNewBookEntry()addBook()endBookEntry()
Book
authortitlepublisheryear
Accesses
Contained-in
1
1*
Catalog
makeNewBook()add()
Use case Browse Catalog Use Case: UC2 - Browse Catalog Actor: Library clerk, Client Success scenario:
• An actor accesses a terminal in order to browse the catalog by entering a keyword that describes a book category. During this session, an actor may repeat this process any number of times. Upon successful match the system displays a list of all books.
SSD for Browse Catalogsuccess scenario
informative message
endBrowseCatalog()
List of matched books
searchForBook(keyword)
browseCatalog()
:Actor:System
loop
Naming System Events and Operations
The set of all required system operations is determined by identifying the system events.• browseCatalog()
• searchForBook()
• endBrowseCatalog()
Domain model Version 2
TerminalLibrary Clerk
Catalog
Book EntrySession
Book
authortitlepublisheryear
Accesses Captures
Accesses
Contained-in
1 1 1 *
1
1
1*
Browse CatalogSession
Accesses1
1
Book Entry has beenrenamed toBook Entry Session
System operations andthe system interface
In the UML the system as a whole can be represented as a class.
Contracts are written for each system operation to describe its behavior.
System
browseCatalog()searchForBook()endBrowseCatalog()
Operation contract: browseCatalog
Contract CO3: browseCatalog
Operation: browseCatalog()
Cross References: Use case Browse Catalog.
Pre-conditions: An instance of Catalog exists.
Post-conditions: 1. an instance of Browse Catalog Session bcs was created. (instance creation)
2. bcs was associated with Terminal
(formation of association)
3. bcs was associated with Catalog
(formation of association)
Operation contract: searchForBook
Contract CO4: searchForBook
Operation: searchForBook(keyword)
Cross References: Use case Browse Catalog.
Pre-conditions: A Browse Catalog session is under way.
Post-conditions: None.
Operation contract: endBookEntry
Contract CO5: endBrowseCatalog
Operation: endBrowseCatalog()
Cross References: Use case Browse Catalog.
Pre-conditions: A Browse Catalog session is under way.
Post-conditions: BrowseCatalogSession.isComplete
was set to true. (modification of attribute)
Object design: browseCatalogContract CO3: browseCatalog
Operation: browseCatalog()
Cross References: Use case Browse Catalog.
Pre-conditions: An instance of Catalog exists.
Post-conditions: 1. an instance of Browse Catalog Session bcs was created. (instance creation)
2. bcs was associated with Terminal (formation of association)
3. bcs was associated with Catalog (formation of association)
browseCatalog() :BrowseCatalogSession
1: create():Terminal
:Catalog
Object design: searchForBook
Contract CO4: searchForBook
Operation: searchForBook(keyword)
Cross References: Use case Browse Catalog.
Pre-conditions: A Browse Catalog session is under way.
Post-conditions: None.
searchForBook(…) 1: find(…)
3: find (…)
:Terminal:BrowseCatalog
Session
2: find(…)
:Book
:Catalog
Object design: endBrowseCatalogContract CO5: endBrowseCatalog
…
Pre-conditions: A Browse Catalog session is under way.
Post-conditions: BrowseCatalogSession.isComplete
was set to true. (modification of attribute)
endBrowseCatalog()
bcs:BrowsecatalogSession
1: becomeComplete()
public void becomeComplete() {isComplete = true;
}
UML notation for a constraint
{bcs.isComplete = true}
:Terminal
Class diagram conclusion
Library ClerkAccesses Captures
1 1 1 *
1
BookEntrySession
makeNewBook()becomeComplete()
isComplete: Boolean
Terminal
makeNewBookEntry()addBook()endBookEntry()browseCatalog()searchForBook()endBrowseCatalog()
Book
authortitlepublisheryear
Accesses
Contained-in
1
1*
Catalog
makeNewBook()add()find()
BrowseCatalogSession
find()becomeComplete()
isComplete: BooleanAccesses