Development Blog With Code Updates : Developercast.com

May 15, 2007

Nick Halstead’s Blog: Bad code, bad data flow, good idea?

Filed under: Development — @ 9:28 am

While developing a new application in a framework, Nick Halstead came across an “oops” point where he realized that the part of the application he was working on could have been coded better. In this instance, he found a spot where he needed to pass data backwards and forwards through the app without loosing “the flow”. His solution? Singletons!

One of these situations occurs when you suddenly that find you don’t have access to data you want, or you can’t pass back (or forward) data as part of the common flow of your application. [...] The solution was to create a singleton class which uses references to bind a name to a already defined variable.

In his example, he illustrates (and explains) how to use a class he developed (varmap) to handle the assignment/removal/etc of the data to the common Singleton object.

No Comments »

No comments yet.

RSS feed for comments on this post. TrackBack URL

Leave a comment

Powered by WordPress