aspose file tools*
The moose likes Java in General and the fly likes Would �Colour�make a good abstract data type? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Java in General
Bookmark "Would �Colour�make a good abstract data type?" Watch "Would �Colour�make a good abstract data type?" New topic
Author

Would �Colour�make a good abstract data type?

Ellen Zhao
Ranch Hand

Joined: Sep 17, 2002
Posts: 581
Would �Colour� make a good abstract data type? Why or why not? Thank you very much!
Dave Landers
Ranch Hand

Joined: Jul 24, 2002
Posts: 401
You mean as in java.awt.Color?
Ellen Zhao
Ranch Hand

Joined: Sep 17, 2002
Posts: 581
No. This question is an exercise of "The ABCs of objects", not neccessarily related to Java language, although the author does describe OOP in Java. Maybe I better put it in that "OO modeling, UML..."board
Dirk Schreckmann
Sheriff

Joined: Dec 10, 2001
Posts: 7023
Colour would make a lousy abstract type because it isn't spelled right (American = right).
Do you think Color would make a good abstract data type? Why or why not?


[How To Ask Good Questions] [JavaRanch FAQ Wiki] [JavaRanch Radio]
Ilja Preuss
author
Sheriff

Joined: Jul 11, 2001
Posts: 14112
What operations would a datatype "Colo(u)r" have?


The soul is dyed the color of its thoughts. Think only on those things that are in line with your principles and can bear the light of day. The content of your character is your choice. Day by day, what you do is who you become. Your integrity is your destiny - it is the light that guides your way. - Heraclitus
Barry Gaunt
Ranch Hand

Joined: Aug 03, 2002
Posts: 7729
get/set wavelength ?


Ask a Meaningful Question and HowToAskQuestionsOnJavaRanch
Getting someone to think and try something out is much more useful than just telling them the answer.
Ilja Preuss
author
Sheriff

Joined: Jul 11, 2001
Posts: 14112
I don't think that get/set are good operations for a datatype (well, get might work...).
A better operation might be something like "mix". Are there more?
 
 
subject: Would �Colour�make a good abstract data type?