We have developed an app for salesforce which uses the salesforce standard product (Product2) object. Now we have got a customer who instead of using the standard product object, uses a custom object for products. My question is what would be the best way for me to implement this without polluting too much of my base code as I know this is a one off case and my other customers will use the standard product object. A couple of ways I am thinking are 1) Use the existing page and controller and do some conditional checking to check if this is my special customer or not. The downside of this is that this will pollute my base code 2) Create new page and controllers for this flow by making a copy of the existing pages. The problem with this is that it will be difficult to maintain.
I would also like to know if there is a module based approach possible in salesforce where I leave my base code as it is an apply an extra module which will override the existing code. If yes kindly provide some pointers as to how this can be done