samedi 1 juin 2019

Is there a specific way to implement abstract factory using sql results?

I'm coding a vehicle rental system and trying to combine abstract factory to use a results from sql query in order to build me my requested array. My main problem now is if its right to do it that way.

I've already implemented two design patterns which I found suitable to my project, the first one is MVC and the other one is Singleton. My MVC model basically communicates with the database directly with sql queries and those results get into a list of objects of the vehicles ranks selected and then get pushed to the singleton "data manager".

Which is the best way to implement my idea on the abstract factory? I expect using the model (from my mvc) to execute the queries and the results will be sent as param with a special definition of Vehicle rank to the factory which will build up a list of objects from that sql result. Is my way of implementing it to my project is good enough to get that design pattern done?

Thanks.

Aucun commentaire:

Enregistrer un commentaire