views:

115

answers:

4

I have purchase Object-Oriented Analysis and Design with Applications, at page 64 paragraph 2 has explain about "is a" hierarchy like below.

In terms of its “is a” hierarchy, a high-level abstraction is generalized, and a low-level abstraction is specialized. Therefore, we say that a Flower class is at a higher level of abstraction than a Plant class.

As I understand, I think plant is more generalize that flower then flower class is at lower level of abstraction than plant.

I want to know at this point my understanding is correct or the book is correct? Please clarify me.

+1  A: 

I agree, this quote is wrong. By the definition here, Plant is at a higher level of abstraction than Flower: the definition is correct, the names in the example are transposed.

David M
A: 

What you have quoted doesn't sound quite right. I would have understood Plant to be at a higher level of abstraction than Flower, assuming Flower inherits from Plant. Therefore,

A Flower is a Plant

but

A Plant is not necessarily a Flower

Russ Cam
A: 

I wouldn't say the statement "A Flower is a Plant" is true, in my opinion a Plant has-a Flower. I think there is some context missing.

I think the author of the book is explaining about inheritance hierarchies here. If an entity is at the top of the hierarchy, it is or needs to be more generalized (or abstract) than the ones below it in the hierarchy. It is bad design to have an entity inheriting from another entity but be more abstract than its parent (translating to an abstract class inheriting from a concrete class).

trshiv
That depends on if you're thinking of a flower as "a plant that bears flowers" or as "a reproductive structure in angiosperms." I think they mean the first one. In that case, it makes sense for `Flower` to inherit from `Plant`.
Blixt
A: 

The plant and flower example for is-a hierarchies is probably the worst I've ever heard!

A car is-a vehicle. A dog is-a mammal. A savings account is-a(n) account. All these are typical and easily understood examples.

CesarGon