lundi 24 août 2020

Design patterns for shape construction

I'm new to the design patterns and I need help to decide which patterns to use on my app.

The task is to write a simple console version of a drawing program, so if you insert:

C - Should create a new canvas of width w and height h

L - Should create a new line R - Should create a new rectangle Q - Should quit the program

So I have thought about using two design patterns. Abstract Factory for the commands and Decorator for the shapes. Is this the correct approach? or do you guys recommend using something else?

Aucun commentaire:

Enregistrer un commentaire