September 2010
Sun Mon Tue Wed Thu Fri Sat
      1 2 3 4
5 6 7 8 9 10 11
12 13 14 15 16 17 18
19 20 21 22 23 24 25
26 27 28 29 30

What I'm reading
I am currently reading The Amber Spyglass by Philip Pullman

Thought for the day
Live as if you were living a second time, and as though you had acted wrongly the first time.
Viktor Frankl, author, neurologist and psychiatrist, Holocaust survivor (1905-1997)

Download the code
You can download the code for the Fuseblog here

Categories

Syndicate this Site - RSS 0.92
Syndicate this Site - RDF

Sep 2010

2002 2003 2004 2005 2006 2007 2008 2009

The Future of Fuseblog
Being Ben Nadel - Mach-II listeners and service layers
CF411 launches
Diary of a Project - PingPong
Thursday - Changing The Game
Thursday - Event Driven Programming
Thursday - HostMySite keynote
Thursday - Continuous Integration with Flex, FlexUnit and ANT
Thursday - Testing CF Applications
Wednesday - BOF - SciFi discussion
Wednesday - Accessibility and RIAs
Wednesday - Head First Mach-II
Wednesday - RAD OO by Peter Bell
Wednesday - Adobe Keynote
Wednesday - Teratech Keynote - Michael Smith
At CFUNITED 2008
Resetting the ColdFusion Administrator password on a Mac
CFNuke making a comeback
Two frameworks talks with the Onlince ColdFusion Meetup Group
CF9 artwork leaked out

Being Ben Nadel - Mach-II listeners and service layers

I've been recently delving into the mysteries that are the Mach-II framework. I'm also trying once again to get my head wrapped around a lot of Object Oriented Programming principles. This time things are making some more sense.

In Mach-II one of the main parts is listeners. They'listen' for events that are announced in the framework and then do something, like get variables, direct he flow of the application, or make calls to your model.

In modeling your business logic for your application, you want to have a service layer. The service layer passes information to the other objects in your model and acts as an application programming interface (API).

The part that I figured out on my own, with a little help from the Mach-II mailing list, was the relation between the two. They are the connecting bridge between the two parts of your application - the framework and the business model.

If your business model is written correctly it will be well encapsulated. It shouldn't know about anything outside of itself. Mach-II knows about itself and how it passes information around (through the event object). But your model shouldn't know anything about the way Mach-II does its thing. The model only cares about things like it needs to get an ID value to run some function.

Mach-II might need to pass a value to the model as something like event.getArg("ID"). It passes this to the service layer first, which then passes it along as just the ID value to the function in the model. This way the encapsulation is maintained and everybody is happy.

The Mach-II wiki just put up this page on the distinction between Mach-II listeners and the service layer which explains it better than I can. But it is nice to know that I came to an understanding of it on my own before finding the docs.

This must be how Ben Nadel feels all the time. ;-)

Posted by jhusum - 06:11 AM - General - Comments - Link to this entry

Comments

hmpILqBdtMGlcD
| e-mail | | webpage |

doors.txt;10;15

October 12, 2009 - 11:55 AM

Crazy36
| e-mail | | webpage |

Why did I so strongly insist on the quantum-mechanical periods the point of view, though I could not really make it clear in this little book and may well have bored many a reader? ,

October 22, 2009 - 06:38 PM

Post your comment:
Fields marked with R are required.

Your name R:
Your e-mail:
Your webpage:
Your comments:

How much is 7 + 6?