The Business Objects
God bless Cuyahoga. Here I had a set of ready-to-go business objects that provided the foundation for the business objects in Charlie. Of course, I could have looked at any open-source website framework to get a similar collection of business objects, but those provided by Cuyahoga were simple and efficient.
I should note that when I say something is simple, it is about the highest praise I can bestow upon a software project. I am very, very tired of looking at software that is needlessly complex. I don’t know whether the developer is showing off, or feels that clean code is somehow amateurish, or perhaps cannot rationalize the code enough to make it simple. Whatever it is, needlessly complex code seems to be the hallmark of second-rate developers. In contrast, simple and efficient code seems to be the hallmark of first-rate developers.
Anyway, taking Cuyahoga’s business objects as a starting point, I fired up Visio and created the diagram you see on the right. As Charlie has developed, some of these classes proved unnecessary, but this was the diagram by which I created Charlie’s original business objects.
I opened the Cuyahoga project in one window, and the Charlie project in another, and created Charlie’s business objects one by one, taking many, many cues from Cuyahoga. For every business object, I applied the five-part Entity System. The Document entity was complemented by a DocumentCollection, DocumentManager, DocumentMapper, and DocumentCriteria. The Container entity was complemented by a ContainerCollection, ContainerManager, ContainerMapper, and ContainerCriteria.
You would be forgiven for thinking that I had done a foolish thing by taking Cuyahoga’s neat business objects and splitting them up into a greater number of pieces. At times, I shared this concern—after all, I do bang on about keeping things as simple as possible. However, I had in mind how this five-part entity system would pay dividends later. Fortunately, the dividends did come, and I’ll talk about the benefits shortly.
I’ll close by saying that, once again, Charlie has benefited from Cuyahoga. (In fact, on the CD to which I copy my backup files, I have labelled it, “Charlie loves Cuyahoga.”)
by Alister Jones | Next up: Charlie is Neurotic →
----
Post a Comment