comment

Recordset: Create Iterating Domain Objects via Inheritance

2007 May 26
No Comments
Now bundled with its distant cousin, the composite Iterator, Recordset provides methods and properties for list traversal via inheritance. Recordset is not a query, but rather a query that is converted to an array of structs. Extending Recordset is useful as an alternative to maintaining an array of objects, or if you want to display a list with calculated fields (an employee has a startdate, but display format is "years of service").

read more...

Use Alias and Apache to Create Custom Mappings

2007 May 17
No Comments
I really love the flexibility Apache gives you when setting up virtual hosts. Another benefit is the Alias directive. I've worked on a few concepts recently that I want to demo as a sample app. After a few revisions, I finally settled on a folder structure and Alias name setup I felt would secure my component classes and facilitate mappings to frameworks and shared libraries.

read more...

Data and Object Modeling 2: Sub/Super Types and Classes

2007 May 15
No Comments
To go along with my previous woolgathering on the correlation between a database schema and a class package, here is another observation regarding class inheritance and sub/supertype tables. In object modeling, we describe the relationship between a subclass and superclass as "is a". The same goes for tables in a data model, where the subtype "is a" supertype. The obvious benefit of using inheritance in object modeling is code reuse. When we add, remove or alter a method of the superclass, the change is automatically inherited by the subclass. In a data model the benefit of using subtypes is arguable. The benefit are that your model better represents the domain, reduces data duplication and (depending on the extent of your normalization) eliminates NULL values. The trade-off is that you are thereafter required to use joins when reading records and transactions when creating, updating or deleting records.

read more...

Data and Object Modeling: The Schema and the Package

2007 May 14
No Comments
When generating object models, I prefer to package related classes together. For instance, a Calendar would have the following classes: calendar.Calendar calendar.CalendarDAO calendar.CalendarService calendar.CalendarGateway Since my controller or view will never invoke methods on my CalenderDAO or CalendarGateway directly, I can secure the methods in those classes by setting access="package". Another subtle benefit is that the component files are organized in a single folder...

read more...

Create Iterating Domain Objects Using Composition

2007 May 10
No Comments
Over the past month, I've worked on some projects that required special data handling and calculated values. I considered using Peter Bell's Iterating Business Object, but instead decided to build an Iterator that can be composed into my domain objects. I'm a big fan of using "composition over inheritance", so I saw this as a prefect opportunity to add iteration to my domain objects with a minimum impact.

read more...

LightWire Configuration Using ColdSpring XML

2007 April 10
No Comments
As a follow-up to Peter Bell's "LightWire or ColdSpring?" entry, I'm happy to announce that LightWire now supports XML configuration using ColdSrping XML bean definitions. With the current release (0.65), you can set your object dependencies with xml, programatically, or a mix of both. This feature supports recursion, factories and optional default settings...

read more...

LightWire and Lighthouse Pro Application Configuration Example

2007 April 04
No Comments
I see a lot of discussions centered around application configuration and the merits of different implementations. Of these, XML cofiguraiton is the most pervasive. A suggested best practice when using xml config files is to keep them outside of the web root to prevent exposing key settings. After recently installing Raymond Camden's Lighthouse Pro, I learned that you can also obfuscate the xml inside a comment block. To try and understand this clever workaround, I openend the hood (a.k.a Appplicaiton.cfc) and noted that with a very small change in onApplicationStart I could introduce both an IoC/DI container and swap out the xml for a programatic config using Peter Bell's LightWire.

read more...

Beware Java For Mac OS X 10.4 Release 5

2007 March 31
No Comments
ColdFusion developers on Mac take note. Updating Java to J2SE Relase 5 will cause a "CFCServlet must be initialized" error when you use Application.cfc. Normally, I don't go hunting down the next version of Java to install, I simply neglected to uncheck this install during a recent Software Update. If you have updated and are currently seeking a fix, my temp fix is to change the CurrentJDK symbolic link under /System/Library/frameworks/JavaVM.framework/Versions back to 1.4.2 (which, by the way was also update, but at least still works!).

read more...

Finding Recurring Dates in MSSQL using HAVING

2007 March 30
No Comments
tags: MSSQL
Recently, I automated a manual billing process for recurring invoices. In order to batch process the job, I decided to use a stored procedure that gets the billing details for all recurring invoices by date. MSSQL date functions DATEADD, DATEDIFF and DATEPART take some getting used to, but are well documented and (once understood) made the query nice and light. What I missed was the fact that not all months are created equal.

read more...

Where is fancy bred? In the heart or in the head?

2007 March 29
No Comments
tags: Ideas
Approximately a decade ago, I intrepreted this phase to mean, "Where do our ideas originate?". At the time, I was intereseted in learning HTML and looking for a creative outlet. Fancy Bread was born as both an outlet and an obsession. Along the way, I learned everything I could on subjects like SQL, Javascript, CSS, Flash and my prefered programming language, ColdFusion. A great majority of my learning has come from online resources. With this blog, I hope to share ideas, tips and tricks, and, of course, rant now and again. All the things you can expect from a guy whose fancy is bred, both in the heart and in the head.