(Front) controller command object name?

Not for 'how-to' coding questions but PHP theory instead, this forum is here for those of us who wish to learn about design aspects of programming with PHP.

Moderator: General Moderators

Post Reply
alex.barylski
DevNet Evangelist
Posts: 6267
Joined: Tue Dec 21, 2004 5:00 pm
Location: Winnipeg

(Front) controller command object name?

Post by alex.barylski »

I solved my other issue which no one seemed interested in anyways so I updated this to reflect my latest problem:

I have front controller and that front controller (directly) invokes required action controllers (no dispatching, etc). Those action controllers communicate back to the front controller via return values. The front controller checks the return "type" and if it's of a given type uses that return value to further process requests or stops right there immediately.

That object that action controllers return to the front controller would best be called???

Message object? I would say Command object but I wouldn't want to confuse readers with thinking it was somehow an incorrect interpretation of the Command pattern. So I figure naming it a 'Message' object is a safe bet.

Really all it does is act like a structure which contains controller:action pairs. There are no methods. Think C structure, but offers the advantage of RTTI for a more OO friendly design.

So what says you, as a developer (not that my framework will ever see the light of day outside of my own projects) what name would make more sense?

Cheers :)
User avatar
Benjamin
Site Administrator
Posts: 6935
Joined: Sun May 19, 2002 10:24 pm

Post by Benjamin »

Hockey,

What if you were to develop a PHP framework which was not only OO, but was engineered like the Linux OS? What if this framework had built in memory management algorithms? What if this framework was so fast and efficient that it didn't require optimizations at all? What if this framework already included SEO features and a CMS. What if I already built this and have it in my code base?

You sure ask a lot of questions, kinda like Condoleezza Rice. But what has been accomplished? What has been completed?

I would encourage you to divert some funds to Amazon.com. They have some really good books. Trust me, I read a bunch. Seriously.
User avatar
Maugrim_The_Reaper
DevNet Master
Posts: 2704
Joined: Tue Nov 02, 2004 5:43 am
Location: Ireland

Post by Maugrim_The_Reaper »

What you have likely has a specific Pattern name - but I wouldn't guess at it :). Like a C struct, it's just a container, a glorified array. Not a glorified array is bad - using an Object gives it the magical property of a unique Type.

P.S. An object without methods cannot be a Command object. Commands generally allow an object perform an action, where the object is unaware of the second "action" object and relies instead on intermediary Command objects. It's a pretty similar pattern to Strategy - the Command objects themselves are Strategies.
User avatar
Chris Corbyn
Breakbeat Nuttzer
Posts: 13098
Joined: Wed Mar 24, 2004 7:57 am
Location: Melbourne, Australia

Post by Chris Corbyn »

astions wrote:You sure ask a lot of questions, kinda like Condoleezza Rice. But what has been accomplished? What has been completed?
Here here. This Front controller topic appears to be never ending 8O
Post Reply