Hi everyone..I need a little help here.Can anybody teaches me on how to create a class diagram for the process of buying glasses from the viewpoint of the patient. The first step is to see an eye doctor who will give the patient a prescription. Once the patient has the prescription, he/she goes to a glasses store, where he/she selects a frame and a lense. and place the order for patient glasses. Once the glasses have been made, patient return to the store for a fitting and pay for the glasses.TQ

Recommended Answers

All 2 Replies

the viewpoint of the patient? when thinking about an application, there's no such thing as a "patient", there are just 'users'.

do you know what a class diagram is? you need to create a list of your classes, their relationships to one another and their members.

A class diagram does not document a process; it's a static view of the class structure of a module or application. Processes like yours are documented in Use Case diagrams.

The very shortest "how to" goes like this: Look through your process description. Underline the important nouns - these are candidates for classes, underline the important verbs - these are candidates for public methods. Eg
"eye doctor who will give the patient a prescription"
possible classes: EyeDoctor, Patient, Prescription
possible method in EyeDoctor: issuePrescription
Now look at how some of these relate to each other - a Patient has zero or more Prescriptions, a Prescription is issued by an EyeDoctor etc

Make a first draft like that, then work through the use cases to see how well it hangs together. Refine the design, add details, delete stuff that isn't really needed. Repeat until satisfied.

And, of course, there's a vast amout of naterial on the web that's all just one short Google away.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, learning, and sharing knowledge.