Me n My Programming

If Only I Have TIme

Lesson Learn – Make universal layout handler

In my diagram, there are three group of icons that I used; EUC icons, Test icons and Other icons.  Each of these groups/icons can be group together to identified their belonging. I used to make separate layout handler to help me organize these icons.

But as the code become more complex, the layout handler also become annoying in term of cross invoke. Sometimes wrong layout handler was called due to improper programming by me. Sometimes I did some modification to the layout structure, then I need to edit all the layout handlers. It is time consuming as I need to spend a lot of my attention to the code to make sure that I don’t call the wrong icons.

As I making this new FB diagram tool, I’m creating only one layout handler to it. I don’t care how many groups there inside the diagram’s but everything will be controlled from one place. Just add a filter up front and make sure it call the right method. With this, I will reduce my code overhead and has a single entry point for all icons.

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

Information

This entry was posted on September 15, 2010 by in Life on Marama.
%d bloggers like this: