Analyzing Model Glue

I still don’t understand why the structure of these different frameworks don’t match up with their architecture (MVC). You’ll have to forgive me, because I’m basically learning three frameworks at the same time! I’m not afraid to discuss my confusion though. Maybe it will help some of you.

I’m sitting here looking at our company’s MVC architecture. The lay of the land is pretty straightforward:

\root\

\root\system\

\root\system\model\

\root\system\view\

\root\system\controller\

Yes, this is MVC. It makes sense. Everything is where it SHOULD be.

Now I venture over to my laptop and have a look at the MG structure:

\root

\root\config\There’s a handler in here??

Oh, and a Coldspring.xml config file is mixed in with it. Yes, this should help me learn MVC! Pfffft!

Continuing…

\root

\root\config\

\root\model\

\root\views\

\root\controller\

Well, the MVC part is right, but to make this MVC application work, I have to work with four different pieces. MVCCH.

Yes, the last β€œCH” stands for config/handler. Because I have to venture in the config directory to work with the handler there, ALL THE TIME. Interesting…

I’m not trying to hammer MG into the ground, just giving you my opinion at first glance. Heck, I figured it was the cat’s meow after hearing so much talk about how easy it is to pick up. Maybe I’m just stupid? OK, don’t answer that!

It gets even more interesting … I have an extra piece to worry about – the message listeners.

Message listeners? Yep! In the config/handler, ModelGlue.xml, I need to setup listeners at the top of the file. They do what they say. They listen to handlers in the bottom of the file, and they act upon a message that’s broadcast to them. They make a call to a controller, which makes a call to the model to do whatever. They look a little something like this:

<controller name=”LoginManager” type=”controller.LoginManager”>
<message-listener message=”OnRequestStart” function=”OnRequestStart” />
<message-listener message=”OnRequestEnd” function=”OnRequestEnd” />
<message-listener message=”OnQueueComplete” function=”OnQueueComplete” />
<message-listener message=”needUsername” function=”reqUsername” />
</controller>

Following me so far? Good, because my next blog entry will explain why I’m partial to Coldbox in relation to all of this.

No comments yet

Leave a reply