






Hotspots: Admin Pages | Turn-in Site |
Current Links: Case Final Project Summer 2007
M6: Domain Implementation
Requirements
The general requirements for this phase of the project are
1. Implement Domain Objects
2. Create SUnit tests
For the first part, there were many different funtionalities required
POS Functionality:
Each POS has an inventory of items
Inventory items are accounted for and lot numbers work effectively
Items auto reorder if they run out
Sale policies are implemented properly
CCS Functionality:
CRUD(Create, Read, Update, Delete) POS
CRUD Supplier
Load and Save Simulation(BOSS etc.)
Handle invoices
Supplier Functionality:
Maintain inventory
Ensures items of the same lot number have the same price
Fills orders and sends invoices to the CCS properly
Our Approach
We worked on this entire part of the project together as a group. We would all
get together at the CoC(College of Computing) and sit around one computer and
code. While some people may say this is not efficient, it was the easiest way
we found to maintain synchronization in the code. There were occasions where 1 or 2
people were working on one part of the project while the others were working on the other,
but since we were all there, everyone had the proper method and variable names.
We finished most of this project before our demo so it took us about 5 or 6 meetings
of a few hours each before we finished this milestone.
Recommendations
First off, even though you can make up lost points in later demos, there is no
reason to put the project off. If you keep that mindset, dead week becomes
busier then usual, and no one likes when that happens.
Second, don't be intimidated by smalltalk. Very few people know any smalltalk
coming into the class so everyones in the same boat. This milestone is where
you should learn most of your smalltalk, so its natural to not know how to solve
a certain problem within the constraints of the language. Remember, you can search
for any class and read how all the methods work and even look at the code for
clarification. This resource will probably help you a lot more then going to
the TA's.
Third, the requirements may seem like a lot, buts its really not that bad. Most
of the requirements are extremely simple to code, and the ones that are not
aren't really that bad. You just need to take the time to understand the
requirement and code it properly.
Lastly, many of you will have never written unit tests before. Its really easy.
They will give you Sunit tests in M1 or M2 to test your code with, just take a look at
them and work from there.
This part of the project really isn't that hard. Just remember to start early and
make good use of group time.
Sample Code
Here are some of the Sunit tests we creates:
setUp
c := CCS new.
p := POSLocation name: 'Test' number: 123.
p1 := POSLocation name: 'Test' number: 120.
s := Supplier name: 'S'.
s1 := Supplier name: 'S1'.
c addPOS: p.
c addPOS: p1.
c addSupplier: s.
c addSupplier: s1.
This method will be run before each test is run.
The next chunk of code changes the sale policy and makes sure
that it offers to sell items in the proper order:
testPOSSalePolicy
| order order2 temp1 temp2 |
self setupPCS.
order := Invoice name: 'i' posNumber: p posNumber quantity: 15 orderType: 1.
order2 := Invoice name: 'i' posNumber: p posNumber quantity: 10 orderType: 1.
p sendOrder: order.
p sendOrder: order2.
temp1 := p items at: 1.
temp2 := p items at: 2.
p salePolicy: 1.
self assert: (p getNextItem: 'i') = temp2.
p salePolicy: 2.
self assert: (p getNextItem: 'i') = temp1.
p salePolicy: 3.
self assert: (p getNextItem: 'i') = temp2.
p salePolicy: 4.
self assert: (p getNextItem: 'i') = temp1.
Link to this Page