Sunteți pe pagina 1din 4

CT070-3-3 Design Patterns

Individual Assignment

Page 1 of 4

Weightage The coursewor is !0" of the assessment for the module# Learning Outcomes: $n successful com%letion of this assessment& the student should 'e a'le to( 1# A%%l) design %atterns a%%ro%riatel) in realistic a%%lications using an o'*ect oriented %rogramming language# +# Criticall) evaluate an e,am%le im%lementation of design %atterns in a %rogramming language#

In this assignment& )ou will 'e im%lementing a sim%le sho%%ing mall in -ava# The mall will %rovide a soothing sho%%ing e,%erience for )our customers& while at the same time allowing )ou to e,%lore the wonderful world of design %atterns. The class diagram which %rovides the framewor for the sho%%ing mall is as follows(

/evel 3

Asia Pacific 0niversit) of Technolog) and Innovation

+013

CT070-3-3 Design Patterns

Individual Assignment

Page + of 4

1ere2s a 'rief descri%tion of each class(

3all
o

The mall itself# 4ither an a%%let or a%%lication# The mall %erforms the creation of a set of different stores& such as a 'oo store& a shoe store& an electronic games store& etc# The mall greets an arriving customer and allows the customer to sho% at the mall# 5ome of the things a customer can do at the mall are( 6et a list of availa'le stores 6et a sho%%ing cart 4nter a store 6et of list of items availa'le for sale at the store Add items to the sho%%ing cart Proceed to chec out and %urchase the items 7ota'le Attri'utes( name - the name of the mall stores - a collection of stores of different t)%es customers - the customers currentl) in the mall Possi'le 3ethods( void enter8Customer c9 - customer c enters the mall void e,it8Customer c9 - customer c e,its the mall 5ho%%ingCart get5ho%%ingCart - returns an em%t) sho%%ing cart 4numeration customers89 - returns an enumeration of the customers in the mall void chec out8sho%%ingCart cart9 - chec out and %urchase the items in the sho%%ing cart

5tore A'stract su%erclass for a store 7ota'le Attri'utes( name - the name of the store storeId - uni:ue ID for the store items - items availa'le for sale in the store customers - the customers currentl) in the store o Possi'le 3ethods( a'stract void enter8Customer c9 - customer c enters the store a'stract void e,it8Customer c9 - customer c e,its the store 4numeration customers89 - returns an enumeration of the customers in the store 4numeration items89 - returns an enumeration of the items availa'le for sale in the store a'stract void addToCart8sho%ingCart& item9 - add an item to the sho%%ing cart a'stract void remove;romCart8sho%ingCart& item9 - remove an item from the sho%%ing cart <oo 5tore o A %ossi'le su'class of 5tore 5hoe5tore o A %ossi'le su'class of 5tore 6ame5tore
o o Asia Pacific 0niversit) of Technolog) and Innovation +013

/evel 3

CT070-3-3 Design Patterns

Individual Assignment

Page 3 of 4

A %ossi'le su'class of 5tore

Item An item for sale in a store 7ota'le Attri'utes( item7ame - the name of the item itemId - uni:ue ID for the item storeId - the ID of the store from which the item came %rice - the %rice of the item Customer o A customer. o 7ota'le Attri'utes( name - the name of the customer sho%%ingCart - the sho%%ing cart 'eing used ') the customer store - the store the customer is currentl) in 5ho%%ingCart o A sho%%ing cart for the customer o 7ota'le Attri'utes( items - items currentl) in the sho%%ing cart o Possi'le 3ethods( 4numeration items89 - returns an enumeration of the items currentl) in the cart
o o

7ote that re:uired accessors and mutators are not listed in the a'ove for the sa e of 'revit)# Assignment Requirements a# 0se the a'ove framewor to write a working version of the sho%%ing mall# '# =our %ro*ect must have at least one customer& three stores and five items for sale at each store# c# Im%lement the user interface an) wa) )ou li e& either te,tual or gra%hical# d# =our %ro*ect must im%lement the following design %atterns( i# Abstract Factory with Factory Methods Create all stores using factories# ii# Singleton Allow onl) one instance of an) factor) t)%e )ou create# iii# Observer All stores should 'e o'serva'le o'*ects# In %articular& a customer should 'e a'le to 'e notified whenever a new item has 'een added for sale at a store# Demonstrate this %attern ') having one or more customers register for such notifications with one or more stores# iv# ommand 0se the Command %attern to enca%sulate the actions s%ecified ') the user 8for e,am%le& enter the store& add an item to the sho%%ing cart9 and then %rovide an >undo> ca%a'ilit)# That is& allow the user to undo a %revious command# ;eel free to use an) other %atterns )ou feel a%%ro%riate# e# $'*ectivel) and criticall) evaluate )our solution including an a%%raisal of the suita'ilit) of each design %attern for im%lementing o'*ect oriented solutions#
/evel 3 Asia Pacific 0niversit) of Technolog) and Innovation +013

CT070-3-3 Design Patterns

Individual Assignment

Page 4 of 4

Assignment !eliverables: =ou should su'mit a hardco%) and an electronic co%) of the assignment# The hard co%) of the assignment must include the following( A cover %age Ta'le of contents $verview of the a%%lication <rief descri%tion of the s)stem architecture 0ser interface documentation <rief re%ort descri'ing the use of design %atterns ?efined class diagram as a result of im%lementing design %atterns Critical a%%raisal re%ort ?eferences A%%endi, 8Instructions on how to install and run the %rogram should 'e %rovided in an A%%endi,9 The electronic co%) of the assignment must include the following( All source files 8=our assignment code must 'e well documented and use a reasona'le indentation st)le# In %articular& %laces where design %atterns are im%lemented should 'e noted in the code#9 All class files An) ma efile& if used =our Assignment Documentation MAR"#$% R#&'R#A =our %ro*ect will 'e graded according to the following criteria( Program Correctness - +0" o The %rogram %erforms all of its re:uired functions %ro%erl)# o The %rogram has no 'ugs# o The %rogram handles a%%ro%riate error conditions %ro%erl)# o The %rogram o%erates with reasona'le efficienc)# Pro%er im%lementation of all re:uired design %atterns - +!" Coding 5t)le - 10" o 6ood reada'ilit) and understanda'ilit)# o Pro%er use of indentation to highlight function flow control# o Pro%er use of comments to highlight distinct features@sections# Assignment ?e%ort - +0" 8$verview& s)stem architecture& user interface documentation& re%ort descri'ing the use of design %atterns and refined class diagram9 Critical A%%raisal re%ort - +!" As in all )our wor & 7$ C$P=I76 $? P/A6IA?I53# If such is detected& no credit for the %ro*ect will 'e given and a%%ro%riate actions for academic dishonest) will 'e ta en#

/evel 3

Asia Pacific 0niversit) of Technolog) and Innovation

+013

S-ar putea să vă placă și