COM 3362 home work - PowerPoint PPT Presentation

About This Presentation
Title:

COM 3362 home work

Description:

COM 3362 home work. Hw 1. UML Class Diagram cg. Library. Book. 0..* books. User. users. 0. ... Find(Library, 'to Book'...) if null: print: no book with given name ... – PowerPoint PPT presentation

Number of Views:16
Avg rating:3.0/5.0
Slides: 6
Provided by: karllie
Learn more at: http://www.ccs.neu.edu
Category:
Tags: com | home | work

less

Transcript and Presenter's Notes

Title: COM 3362 home work


1
COM 3362 home work
  • Hw 1

2
UML Class Diagram cg
BookName
val
bN
Book
Copy
Library
copies
books
0..
book
0..
avail
copy
checkOutItems
0..
users
Availability
CheckOutItem
String
val
0..
uId
User
Boolean
UserId
val
3
In Java using DJ
  • class Library
  • Copy CheckOut
  • (Library lib,BookName bN, UserId uId)
  • Book b cg.Find(lib,to Book,bN,bN)
  • Copy c cg.FindDeep (b,to Copy,
  • to Availability,val,true)
  • User u cg.Find(lib,to User,uId,uId)
  • cg.Add(u,to Copy,c)
  • cg.Set(c,to Availability,val,false)
  • return c

4
Specification in Java
  • class Library
  • Copy CheckOut(Library lib,BookName bN, UserId
    uId)
  • Book b cg.Find(lib,to Book,bN,bN)
  • Copy c cg.FindDeep (b,to Copy,
  • to Availability,val,true)
  • User u cg.Find(lib,to User,uId,uId)
  • cg.Add(u,to Copy,c)
  • cg.Set(c,to Availability,val,false)
  • return c

implement error handling as an aspect in
CheckOut Find(Library, to Book) if null
print no book with given name FindDeep() if
null print all copies checked out
Find(Library, to User) if null print no
user with given id
5
Advantages
  • High-level description of behavior in terms of an
    ideal UML class diagram
  • Behavior can be adapted to many concrete class
    diagrams
Write a Comment
User Comments (0)
About PowerShow.com