Help with Class designs

As part of an assignment i have to come with some class diagrams for :

Customer, MobilePhone , PackageCategory, Manufacturer, LatestPhones, CreditCardDetails

I have identified the attributes but need the methods to the follwing classes:

Customer (Class Name)

Name

Full Address

Telephone Number

Email Address

Password

Package (Class name)

Pay as you go

Contract

Manufacturer (class name)

Product Code

Key features

Price

CreditCardDetails

TypeOfCard

NameOfCardholder

CardNumber

ExpiryDate

SCC number

What would be an example of the methods used

[682 byte] By [abolakramia] at [2007-9-28 9:26:07]
# 1
Methods should be determined from the functionality that you want to implement for the specific class. Like Customer - getName() etc. Regards, D.
dstavrakova at 2007-7-11 22:30:21 > top of Java-index,Other Topics,Patterns & OO Design...
# 2
I think you are just starting with OOAD, see if you like CRC technique for finding the operations.- Karthicraja
karthicrajaa at 2007-7-11 22:30:21 > top of Java-index,Other Topics,Patterns & OO Design...
# 3
CRC technique? What is that?
benc3a at 2007-7-11 22:30:21 > top of Java-index,Other Topics,Patterns & OO Design...
# 4
Hi,First of all you should have getter and setter methods for the attributes and also depending upon your need you can have as many method you want...like String getName(), setName(String name) etc..Hope this will help you...-Abhay
abhay_mehrotraa at 2007-7-11 22:30:21 > top of Java-index,Other Topics,Patterns & OO Design...
# 5
that would be the last thing to do :)> First of all you should have getter and setter methods
mchan0a at 2007-7-11 22:30:21 > top of Java-index,Other Topics,Patterns & OO Design...
# 6

If you only need to come up with a class diagram, but do not know what functionality the system will require in the end - you should not worry about methods at this stage. Try thinking about the relationships between the classes. Ask yourself some questions about the model.

Can a customer have more than one phone? Maybe.

Can a phone be on more than one plan? No.

etc.

etc.

zigvelveta at 2007-7-11 22:30:21 > top of Java-index,Other Topics,Patterns & OO Design...
# 7
Check these links http://www.ccs.neu.edu/home/futrelle/teaching/com1204sm2002/uml/crc/crc.htm http://www.informatik.uni-bremen.de/uniform/vm97/methods/m-crc.htm- Karthicraja
karthicrajaa at 2007-7-11 22:30:21 > top of Java-index,Other Topics,Patterns & OO Design...
# 8
One way to to identify the methods is to start from use cases and event flows. Here is an example: http://www.theserverside.com/patterns/thread.jsp?thread_id=17595Nalla
nsenthila at 2007-7-11 22:30:21 > top of Java-index,Other Topics,Patterns & OO Design...
# 9

After I have the class models. I usually will find the relationship between the class models I created:

1. Creation

What creates what? For example, UserFactory creates and deletes User object.

2. Ownership

What has what? For example, User has exactly one CreditCardDetails. The relationship can be 1-1, 1-n, n-m. We can use setter/getter methods for this.

3. The interaction.

What does what? For example, you only allow credit card access/create/update only thru User object. You can pass other class as parameter and expect other class as result.

rgds,

Alex

lexzeusa at 2007-7-11 22:30:21 > top of Java-index,Other Topics,Patterns & OO Design...
# 10
If u can provide us problem statement, we can think abt methods and relationship between classes.rightnow getter and setter methods only we can think of
redwina at 2007-7-11 22:30:21 > top of Java-index,Other Topics,Patterns & OO Design...