case study in analysis: a library information system

25
Case Study in Analysis: A library information system

Upload: grant-mckinney

Post on 21-Jan-2016

222 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: Case Study in Analysis: A library information system

Case Study in Analysis: A library information system

Page 2: 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.

Page 3: Case Study in Analysis: A library information system

SSD for Make Book Entrysuccess scenario

confirmation

endBookEntry()

confirmation

addBook(author, title, publisher, year)

makeNewBookEntry()

:Library Clerk:System

loop

Page 4: Case Study in Analysis: A library information system

Naming System Events and Operations

The set of all required system operations is determined by identifying the system events.• makeNewBookEntry()

• addBook()

• endBookEntry()

Page 5: Case Study in Analysis: A library information system

Domain model conclusion

TerminalLibrary Clerk

Catalog

Book Entry

Book

authortitlepublisheryear

Accesses Captures

Accesses

Contained-in

1 1 1 *

1

1

1*

Page 6: Case Study in Analysis: A library information system

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()

Page 7: Case Study in Analysis: A library information system

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)

Page 8: Case Study in Analysis: A library information system

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)

Page 9: Case Study in Analysis: A library information system

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)

Page 10: Case Study in Analysis: A library information system

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

Page 11: Case Study in Analysis: A library information system

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

Page 12: Case Study in Analysis: A library information system

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

Page 13: Case Study in Analysis: A library information system

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()

Page 14: Case Study in Analysis: A library information system

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.

Page 15: Case Study in Analysis: A library information system

SSD for Browse Catalogsuccess scenario

informative message

endBrowseCatalog()

List of matched books

searchForBook(keyword)

browseCatalog()

:Actor:System

loop

Page 16: Case Study in Analysis: A library information system

Naming System Events and Operations

The set of all required system operations is determined by identifying the system events.• browseCatalog()

• searchForBook()

• endBrowseCatalog()

Page 17: Case Study in Analysis: A library information system

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

Page 18: Case Study in Analysis: A library information system

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()

Page 19: Case Study in Analysis: A library information system

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)

Page 20: Case Study in Analysis: A library information system

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.

Page 21: Case Study in Analysis: A library information system

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)

Page 22: Case Study in Analysis: A library information system

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

Page 23: Case Study in Analysis: A library information system

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

Page 24: Case Study in Analysis: A library information system

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

Page 25: Case Study in Analysis: A library information system

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