Re: What's the Criteria for Promoting a "Thing" to a Class





On Dec 28, 8:53 pm, "Daniel T." <danie...@xxxxxxxxxxxxx> wrote:
mySpa...@xxxxxxxxx wrote:
I'm an OOAD noob, and I'm thinking that "State" (as in the "S" of the
U.S.A.) qualifies as a class, and should be represented as a Class in
my Class Diagram, with its two properties: name and abbreviation.

Similarly, I think that any type of lookup (in DB ERD terms) should be
modeled as a Class in the class diagram.

My colleague is of the opposite opinion, and thinks that there
shouldn't be classes for these "lookups."In order to know, ask yourself, what responsibilities do objects of the
class have? If you can come up with an some, then it should be a class,
otherwise it is nothing but data associated with some other class.

Is it lame to call simple accessors "responsibilities?" For state, it
would be getName() and getAbbreviation(). The same sort of thing would
go for the other "lookups."

If this doesn't qualify, say, State, as a class, then what does this
property (or set of them?) look like (as far as data type, etc.) in the
Class Model of the containing class (say, "Contact")?

Depending on the language, we may represent something that doesn't fit
the definition of class by OO standards as a class in the language,
simply because it is useful to do so. Such data bundles are used by OO
classes to get work done.

Are you just saying that sometimes, you pass data around in a class as
a transfer mechanism, not because the class fits a tidy object, but
because it's convenient? If so, I'm not sure what to make of this in
the context of my question. I think I'm missing your point here.

It is important not to confuse representational models with OO models.

Sorry, I don't understand this one either, and it's not Googling well.
What's a representational model?

Jamie

.