Hi arun

I would say that the better you model the better your software will be.

First of all, i would suggest that you try to see which are the classes you need to model for the software you're making.

Once you have all that then you may start to group them and find super classes and so on.

What I mean is the following......

I guess that all quadrilaterals (which I believe to be poligons of 4 sides) ARE poligons.

so I would say that quadrilateral should be a subclass of polygon.

Apart from that, a rectangle is a particular quadrilateral, so as rectangle ARE quadrilaterals then the rectangle class should be a subclass of quadrilateral.

So you would have that rectangle is a subclass of quadrilateral and quadrilateral is a subclass of polygon.

(Indirectly rectangle is a subclass of polyline).

This would be a correct model.

Now.... the model I previously described, although correct, may be modelling some things that are not necessary.

Suppose that figures you will work on have 4 sides, so that there all polygons you'll use have 4 sides, so they are quadrilaterals. Then it is not necessary that you have a polyline class. Then your base class will be quadrilateral and you'll make your class hierarchy from there.

Hope this helps

Tincho

I would say that the better you model the better your software will be.

First of all, i would suggest that you try to see which are the classes you need to model for the software you're making.

Once you have all that then you may start to group them and find super classes and so on.

What I mean is the following......

I guess that all quadrilaterals (which I believe to be poligons of 4 sides) ARE poligons.

so I would say that quadrilateral should be a subclass of polygon.

Apart from that, a rectangle is a particular quadrilateral, so as rectangle ARE quadrilaterals then the rectangle class should be a subclass of quadrilateral.

So you would have that rectangle is a subclass of quadrilateral and quadrilateral is a subclass of polygon.

(Indirectly rectangle is a subclass of polyline).

This would be a correct model.

Now.... the model I previously described, although correct, may be modelling some things that are not necessary.

Suppose that figures you will work on have 4 sides, so that there all polygons you'll use have 4 sides, so they are quadrilaterals. Then it is not necessary that you have a polyline class. Then your base class will be quadrilateral and you'll make your class hierarchy from there.

Hope this helps

Tincho