Wednesday, January 7, 2009

Reflection - training new developers

I have been helping a co-worker do some work that has really caused me to look at some high level principles. I like this, and wanted to capture some of the thoughts. first off, we are following the SOA design patterns in our development. this to me means - creating a service oriented architecture, where the service objects are the big dogs in the playground. they are at the conceptual front of the domain line. They are who is called when some application wants to get at some data.

In our application, we are using machii, so there are listeners that are registered as part of the application. Whenever the application does something - it is funneled through the controller (a xml file) in the form of an event. If the event needs to speak to the data layer - then is uses one of the registered listeners to do that.

The listener has lots of functions in it and has *knowledge of the event and the arguments or parameters *URL variables that are passed around (this is usually either URL or form data served up by a view page. The listeners job is primarily to pass things along - pieces of data that the service will need that determines what to do with it.

This is know as the bus. logic and should live downsteam from the application and listeners. The bus. logic should live in the service and in the persistance objects.

So, while helping my co-worked to understand all this abstraction of layers - i found myself using works like design patterns, service oriented architecture and persistence beans - including anemic -vs- rich beans. When you have to explain to someone why things are how they are, it makes you think very critically about the why portion - and you better have more than a "because thats how i found it" response.

I am also using coldSpring - so i talked about where the service gets its knowledge of things from. rather than the service objects creating its dependent objects itself - that knowledge is abstracted from the collaborating objects and into a *container xml file that does it for you. Brilliant!. I do like coldspring alot! I talked with her about where this new piece of bus. logic should go and where it should come from and why. It was a neat experience.

Im not saying that i have all the answers or that the answers that i have are perfect, im just saying it felt good to explain this stuff and to see her seem to get it.

No comments: