View this PageEdit this PageAttachments to this PageHistory of this PageHomeRecent ChangesSearch the SwikiHelp Guide
Hotspots: Admin Pages | Turn-in Site |
Current Links: Case Final Project Summer 2007

M6: Domain Coding

M6: Domain Coding

Welcome to M6! This was the first coding milestone,
which came as a blessing for some in the group.
Here was when we started to encounter our largest
problems, which was mainly with not having enough
functionality. This part could very easily take the
most time, so start as early as possible.

General Tips:
and got lucky that we started around M5.
and having everything work properly will probably not
happen the first time through.
some of our CRC cards had much more functionality, in
retrospect, than we realized. Mainly with items and
lot numbers.
functionality if you can, but make sure to hit all
of the guideline by the deadline.

Smalltalk Coding Tips:
practically insisted making the code near unreadable,
which makes life much more difficult for everyone else.
being objects, there is no telling what will break/work
until testing.
coders and makes the code understandable without having
to read through it every time.

Example of BAD CODING
itemReport: aPos theItem: anItem
	"Iterates through invoices, checks POS against invoices, checks items at POS. Also: GOOD LUCK UNDERSTANDING THAT CODE BLOCK (just format it; I like it dirty)"
	|theOrder numTimesOrdered allOrders sortedInvoices currBuyPrice|
	theOrder := Order new.
	allOrders := Orders new.
	numTimesOrdered := 0.
	currBuyPrice := (anItem buyPrice).
	sortedInvoices := SortedCollection sortBlock: [:a :b | a item buyPrice < b item buyPrice].
	filledInvoices do: [:currentInvoice | sortedInvoices add: currentInvoice]. 
	sortedInvoices do: [:currInvoice |(currInvoice pos name = aPos name) ifTrue: [ (anItem lotNumb = currInvoice item lotNumb)  ifTrue: [ (currBuyPrice = currInvoice item buyPrice) ifTrue: [theOrder pricePoint: ( currInvoice item buyPrice). theOrder timesOrdered: (numTimesOrdered + 1). numTimesOrdered := numTimesOrdered + 1.] ifFalse: [allOrders orderCollection add: theOrder. theOrder := Order new. numTimesOrdered := 0. theOrder pricePoint: (currInvoice item buyPrice). theOrder timesOrdered: (numTimesOrdered + 1). currBuyPrice := (currInvoice item buyPrice). allOrders orderCollection add: theOrder.].].].].
	^allOrders

This could easily be put into more methods that would make it nicer. Also, RIGHT CLICK AND PRESS "FORMAT" AND IT WILL LOOK SEMI-READABLE!

This is our Supply Chain Code (Final):
TeamApathy.rar

Link to this Page