jeudi 30 août 2018

Create complex class with factory and builder

background: I build a class diagram for shopping on the net. For creating a user interface with tow type (golden-User and silver-User) I use the factory pattern.
But the User class become to be very complex.

How can I create this class by bulider and on the other hand the ability to specify the user type such as the factory will remain on the class name (will help me to recognize which type is by polymorphism and not by if&else)

Aucun commentaire:

Enregistrer un commentaire