Welcome Guest, Not a member yet? Register   Sign In
I'm at a standstill....need help with controllers (theory)
#10

[eluser]jleequeen[/eluser]
[quote author="Colin Williams" date="1220135616"]
Quote:I realize how large a checkout method in the cart controller might be as it should be. Like you said, it does a lot of stuff. But, to me, it would be better to actually have a “checkout” controller, because it just seems a waste to have all those other methods in the cart controller that have to get loaded that won’t be used on that request.

Well, it can be argued all day long, but your almost always controlling an action on an object. So a checkout controller is an action-focused controller, and a cart is an object-focused controller. I suppose you can mix and match as you see fit. You obviously do have a good clue of how you prefer to organize your app. I think there are many right ways to do things any many wrong ways to do things, and a few gray areas. What a shocker! ;-P[/quote]

I see what your saying and yes there is a lot of gray. As an example, say I have several forms that a person needs to fill out that produces a "plan". Each of these forms hit up to 3 tables of information. So there is no direct correlation between one table per controller or whatever. If I were doing object focused controllers, would I have a "plan" controller and each form would then be an action within that controller, even though technically each form uses different tables and really have nothing to do with one another, other than they are grouped together because they eventually make this "plan". Or is that not exactly the object focused controller that you are talking about? Because obviously I have no plan table in my database, there are many tables in my database that eventually becomes the plan. Is this when the idea of a "plan" object focused controller breaks down a bit and I need to look at smaller controllers?

Ah, flexibility and freedom are great, once you know what to do with them! Smile


Messages In This Thread
I'm at a standstill....need help with controllers (theory) - by El Forum - 08-30-2008, 11:46 AM



Theme © iAndrew 2016 - Forum software by © MyBB