Fusioncube

The online journey of a technophile, by Steve Brownlee

Archive for February, 2009

PureMVC is for zealots

Friday
Feb 27,2009

As time goes by and I work more with the PureMVC framework, the more I like Mate for Flex development. As I’ve mentioned in previous posts, I find true value in frameworks that do three things:

  1. Provide design patterns that can be standardized by a team without enforcing a rigid standard.
  2. Provide flexibility on how to implement design patterns.
  3. Make development faster for experienced, and new, team members.

Obviously, PureMVC easily fulfills goal numero uno, but it does not fulfill goal numero dos or tres. I actually feel better about this decision now that I’m nearing completion of a full application written in PureMVC. I’m comfortable with the architecture, and can easily explain it to others and know all the basic mechanisms. I still don’t like it.

I’ll itemize my areas of concern:

  • It doesn’t use the event model provided by Flex. Sure, I understand the concept behind using Notifications instead, but we’re developing in Flex, we’ll be deploying in Flex, and continue to do so for the foreseeable future. Completely unnecessary overhead for our team.
  • The Application Facade. Again, for us, a bloated and unnecessary feature, especially when we need to implement PureMVC Proxies for our data model.
  • I prefer an Observer pattern over a Mediator pattern simply so I can avoid the common result of the Mediator pattern, a 1200-line long file.

When it comes down to brass tacks, Cairgorm, PureMVC and Mate provide the EXACT SAME capabilities, but they differ in how they expose the features and how flexible you can implement them. Cairngorm cannot do anything that Mate cannot. PureMVC cannot do anything that Cairngorm cannot, etc.

Given the choice between three things that perform the same function (in much the same way I buy a car – they all get me from A to B) I will choose the one with the lowest cost of ownership. This is where I know I differ from many people in my opinion about a Flex architecture. Many folks I talk to have a “rules will set you free” mentality – meaning that if you have a rigid implementation strategy, then there’s no thinking involved.

I agree.

However the strategy should be developed by the team so that it fits the goals of the organization and/or product rather than forcing one upon everyone.

So who can tell me why I’m wrong?

Thursday
Feb 12,2009

Following up on my original post about ColdFusion performance hits on creating objects – it was suggested that I return an array of typed structures instead of an array of components.

I already had a nice AOP class for each of these scenarios, so all I had to do was add the __type__ column to the array of structures, and I was good. The test results below seem logical… except for the first set of testing 50 rows. Converting the query results into an array of structs using a simple function call to another component was actually SLOWER than using AOP or converting to DTOs.

Besides that anomaly, the performance hit for using ColdSpring AOP proxies and using DTOs is clearly visible as you add more data.

50rows



250rows



500rows



1000rows

Thursday
Feb 12,2009

I’d heard other people in the community mention that, while ColdFusion 8 was faster, object creation was notoriously slow. I never understood what they were talking about as I was creating up to 3000 DTO objects to pass to Flex and was seeing times between 300ms-2000ms for the entire process.

Well, today I discovered what they were talking about. While architecting a new piece of functionality in one of our apps, I needed to create a DTO that has 57 properties. Also, the data set for each user averages 1000+ rows (and, thus, 1000+ DTOs created). The execution times startled me at first.

Here are my notes.

With 57 Attributes
==============================================
	300 rows
	==============================================
	4438ms for converting to DTOs (100% slower)
	2216ms for no conversion

	1070 rows
	==============================================
	10485ms for converting to DTOs (198% slower)
	3516ms for no conversion

With 20 attributes
==============================================
	300 rows
	==============================================
	2250ms for converting to DTOs (20% slower)
	1875ms for no conversion

	1070 rows
	==============================================
	5735ms for converting to DTOs (144% slower)
	2344ms for no conversion

I always knew that the number of objects created would always increase time, but I never realized that the size of the object would have such an impact. In the past, I’ve always dealt with DTOs that had less than 10 properties.

Now we have to make a hard decision on when, or perhaps how, to implement DTOs when using ColdFusion to send data to our Flex UIs. We either have to come up with a way to do pagination in our requests (only request 200 rows at a time for large objects), or abandon DTOs altogether and work with the native ArrayCollection type passed back for ColdFusion queries. I’d hate to lose my types data objects in Flex, but if the impact is making a user wait for 10 or 20 seconds for his/her data to load, we’ll have to find an alternative.

Steelers Win Number 6 – and the whining begins

  • Filed under: errata
Monday
Feb 2,2009

I was telling everyone that I thought this would be an exciting Super Bowl, no matter who won (and I knew the Steelers would win), and I wasn’t proven wrong. That was the most exciting Super Bowl that I remember watching, and I still remember – albeit vaguely – the wins back in the 70′s.

I have to give it to the Cardinals, they played an amazing 2nd half and there was a lot of nail biting in our house last night. Big Ben went up a few more notches in my opinion as he had a gutsy performance.

I had to laugh, though, reading the comments on ESPN and NFL.com this morning. The whiners always come out of the woodworks after a Super Bowl loss – blaming the refs, proclaiming favoritism in the league and the officiating, talking ad nauseum about “we should have won because of x”. I guess the concept of “one play does not make a game”, and the phrase “graceful loss” are lost on some people.

One guy even went so far as to say that the entire NFL organization wanted the Steelers to win because they’d make more money that way, and ordered the officials to call the game in favor of Pittsburgh.

<chuckle>

Dallas can call themselves America’s Team, but I think we all know who that really is now. The fact that I bleed black & gold does not tarnish my opinion at all ;)

Latest Tweets

  • Watch video on this page to see a quick shot my family's biz and a heapin' helpin' of Pittsburghese - http://bit.ly/aMxuLN
  • Ever wonder how insignifcant the Earth is on a cosmic scale? http://bit.ly/PV4o
  • How did I miss this highlight??? Hasek takes out Gaborik http://su.pr/1KZtN2
  • Rooted & upgraded my HTC Hero w/#Froyo. Holy shit is it faster and have improved features. Painless, too. http://bit.ly/cBjvuH #fusprint
  • @Antipimp You will do what Father Jobs tell you to do, peon.