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

-M6 Domain Coding OOPS

M6: Domain Coding


The M6 is Domain Class Coding

Comment:
The domain class coding requires a thorough understanding of the internal structure of the system being built. Make sure to get all the function for each class is implemented. This will make M7 very easy.

Requirements/Grading Criteria:

      o Patients keep track of personal information and status...........05 
      o Patients have a record of treatments................................05
      o The hospital maintains a list of patients ......... 05 
      o The hospital maintains a list of doctors ..................05 
      o The hospital maintains a record of rooms and their association with patients ...............05
      o Doctor Keep record of pertient information.................................................5
      o Doctor Keeps record of pertient information ...................5 
      o Doctor Associated with patient correctly .......................5
      o Admin rights ..................5 
      o Doctor rights .................5 
      o User rights ....................5 
      o Login ...........................5
      o Data is saved .................10 
      o Data is loaded back .........10
      o SUnit Tests ...........................................................................20 
      o Good Smalltalk comments, code and style....................................10

Coding Example:

Whether you understand good smalltalk coding style can determine how complicated this part of the project can get.
If you are familiar with smalltalk coding style, this milestone is extremely easy.
However, if you haven't familiarized yourself with the smalltalk coding style yet, this part can be extremely hard to complete and to debug.

Following are two example codes both of the same message for the Hospital class #getInpatient.
It returns a OrderedCollection of patients that are inpatient.
The first doesn't follow good smalltalk coding style, whereas the other uses good smalltalk coding style.

Bad: This is not a bad programming in general. If you were coding in Java, this is how it would be done.

	getInpatient
	    | inpatientList |
	    inpatientList := OrderedCollection new.
	    patientList do: [:patient| ((patient status) = #inpatient) ifTrue:[inpatientList add: patient.].].
	    ^inpatientList.

Good: This is a good smalltalk code. It utilizes preexisting smalltalk messages effectively to reduce the code.

	getInpatient
	    ^patientList select: [:patient| patient isInpatient.].


Notice the difference in how many lines of code each has.
Understanding the object/message coding style can make coding extremely easy.
Get familiar with it.

Link to this Page