mattsoundworld wrote:If write CustomCatalog instead of remarking all the old controller to something else, you lose SEO as your URL will look ugly now, you lose most of the original functionalities except your "extra". There is another way to change how URL mapped in RouteProvider, but again, a bit of pain.
I just want to clear up something very specific. Maybe I chose a bad example. Lets use an existing example
routes.MapRoute("CustomCheckout", // Route name
"/checkout", // URL with parameters
new { controller = "CustomCheckoutController", action = "CustomCheckoutAction" }
// Parameter defaults );
Does nothing to your SEO. ~/checkout is still checkout, but it calls your new controller instead of the old one. All the other routes still map to the old checkout controller.
I think you are locking in on the idea of overriding a CONTROLLER with routes, as opposed to overriding individual ACTIONS.
In this case, your CustomCheckoutController would not need to have any relation to CheckoutController (utility functions aside). It could even be a class of just one action if that's all you need.
I guess there becomes a tipping point between how many routes you override vs. how many routes you leave the same, but if you have to override the majority of the routes or install a significant amount of functionality, why inherit/partial in the first place?
Sorry when I said SEO, I meant if you leave CustomCheckoutController as is without replacing the name, then your URL will become mydomain.com/CustomCheckout/{action} which is quite ugly from SEO perspective. You will have Custom everywhere.. or everyone will have Custom everywhere and google weight heavier on words in the URL.
In terms of tipping point, I totally agree. At this stage, I might only change 1 method, maybe I add some services to the ctor, but I can't tell what my team will do after we go live. Easier future upgrade is always my considerations when I choose a technology.
1 of my other requirements is multi-tenant. With partials, I am going to end up with Brand1PartialProductController, Brand2PartialProductController etc... and that their functionality maybe completely different.
With inheritance, IoC took care of it.
To add to the complexity, I am implementing a MyCoreController, that would implement nopCoreController, and all my brands will implement MyCoreController. This way I have flexibility to add functionalities to all 15 brands in MyCore or only add brand specific in Brand1Controller, and I can still leave upgrade path for nopCoreController.
I hope I am making sense, and I am not ruling out anything, I also went down to the partial path at the very beginning, it seems it is the way how nop designed but looking at the requirements of all 15 brands, I can't estimates how many partials I will end up with?