lundi 21 novembre 2016

Can`t decide between 2 design patterns for shape drawing

Good afternoon,

For an excersise I have to design an app that creates shapes like a rectangle. To draw a rectangle you should call a display() function with four parameters: x, y, w, h (bottom left coordinates, width and height). Now a new client wants to call the display method with top-left coordinates and bottom right coordinates.

I am trying to decide which design pattern suits this task best. Factory or builder design pattern?

Thanks in advance.

Aucun commentaire:

Enregistrer un commentaire