tags:

views:

195

answers:

1

Hey guys!

I have an application here that is growing bigger and bigger. The address is this: www.aquitanda.com [brazilian portuguese].

Basically, it's a website where you can buy and sell stuff on your own, which means people can create their own webstores.

I have, for this project, 4 big "interfaces". One of them is the commom interface, where anyone can browser, register as a user or as a store and so on. I have another interface where people manage their preferences, their profile and so on, this is the user interface. There is the store management interface, where people add products, categories, check out orders and so on. The last one is the interface of the stores.

This means that I have a lot of code that share same models and same controllers, but my controllers are getting huge and maintanence is getting harder and harder to make.

See, I have fat models. It's not because actions are getting to much code. It's just because I have a lot of actions.

So I moved my code into plugins, but that isn't feeling very "right" to me anymore as I want to use plugins for other stuff instead of interfaces actions.

Is there a suggestion in order to organize this any better? Should I just use prefixes and let my controllers huge? Should I stick with plugins [maybe with custom paths]? Will v.1.3 introduce anything new on this subject? Should I wait the stable version? Any other alternatives?

Thanks ;)

+1  A: 

I don't think plugins are what you want as they are self contained. If your models are already fat and you want to slim down your controller logic the next step would be identifying if any controller code should belong in a component.

Mathew Attlee
Yes, move the plugin code into components.
powtac
Agreed. However, as a warning, it also sounds like you just have a ton of lines of code. At some point, you're going to have to deal with having big controllers: if you have 300 different actions for a single controller, there's not really much you can do to reduce source complexity except try what everybody else has.
Travis Leleu
And what exactly is that everybody else has tried?
Eber Freitas Dias