I was wondering how you'd be able to map the following criterias to common design patterns. I use PHP 5.3 and MySQL 5.5 and have my own mvc framework for my company but some parts could be better and here are the requirements:
(Take the concept of a catalog since it's the first app that would be affected in our application pool)
The controllers (products, clients and basket) all manage different information namely their own set of models. For example, the basket will create basket objects in memory, assign products to it, quantities, etc. Then it will save the basket to database and try the payment logic and save the payment associated to the basket.
My issue is that most of the time, our clients want to customize the different objects such as the client (add more coordinate fields or descriptive fields) or the product (add custom properties to the product). If my controller always refers to the class product but i want to extend it to create:
MyCompany_Models_Product MyClient_Models_Product extends MyCompany_Models_Product
How will i setup my system to support extension of classes and change the classes used by my different modules, controllers, views and other models. If i hardcode MyCompany_Models_Product as the class name in the controller and all other object, how would i go at creating an overridable system.
Is there any pattern i can go for that will leverage this problem?