Today is a good day to code

Why Separate Business Logic From Display Code – Is That a Trick Question?

Posted: December 31st, 1969 | Author: | Filed under: ColdFusion, Programming, Uncategorized | Tags: , | No Comments »

Why Separate Business Logic From Display Code – Is That a Trick Question?

Picture of Irv Owens Web DeveloperI was perusing the web the other day when I came across a site that was questioning the need for OO (Object Oriented) code in a language like ColdFusion. The author suggested that PP (Procedural Programming) was often faster as it involved much less overhead, and asked the question if it was truly necessary to strictly separate business logic from display code. I could see points in this persons argument up to this point. Not separate logic from display, was he mad? Still, to a developer who has not worked on complex applications, and has stuck strictly to commercial sites, I can see where the computing overhead and design complexity required of creating usable software would seem absurd. I can even see where EPAI (Every Page is an Island) can be of benefit in commercial sites with only several dynamic pages.

Having maintained large applications developed both with a framework and using elements of OO, as well as maintaining large applications built with no framework and EPAI, I can definately say that the applications developed with the framework and elements of OO are much easier to take care of. The primary reason is that there is a higher level of encapsulation per object, so that each individual object does only one task, and that task it could perform independent of any other objects. This way it is very easy to troubleshoot that one piece. As you continue through troubleshooting each piece you are most assured to find the issue. With EPAI, troubleshooting becomes difficult because each page has display logic mixed in, and can be performing several tasks, especially if it is sumitted to itself in forms. Even with appropriate variable scoping, it is still hard to determine what is setting what where.

I would suggest that the person who suggested that there was no benefit to separating business logic from presentation logic read Design Patterns by the Gang of Four, Gamma, Helm, Johnson, Vlissides. After reading a brief excerpt from the preface of the book I knew that it could help me solve some of my design problems. The issues in the book are real-world issues and as such the solutions make sense. After reading this book, the extra system overhead and complexity should seem worth it in many cases. However, this does not mean that it applies in all cases. Invariably there will be exceptions, for example where performance is the highest priority for a given operation. In this case you may wish to bypass the framework you have developed or are using for this operation, if the overhead it incurs is significant. This is just one example of many where design patterns and maybe even OO may not be the best solution to a problem. Remember, that is what programmers are doing, solving problems. Design patterns are just to give us more tools to do so.


Why Flash is Still Oh, So Wrong for So Many

Posted: December 31st, 1969 | Author: | Filed under: JavaScript, Programming, Uncategorized | Tags: , , | No Comments »

Why Flash is Still Oh, So Wrong for So Many

Picture of Irv Owens Web DeveloperI have recently come under some minor pressure from various factions about why, while knowing Flash fairly well, I am always reluctant to design and build a flash site featuring the technology. My history with Flash is pretty much the same as most other developers. My first versions of this very site three or four years ago were made entirely in Flash, as were many of my customers sites. Flash seemed like the way to go. It rendered the same in every browser, fonts weren't an issue, and it allowed an incredible amount of freedom to create.

So why then were my sites so problematic. The first issue was one of bandwidth. I had music and lots of motion on these sites. They were extremely interactive and eye catching. The problems came up when users had to come to my site using dial-up. When they hit the site and saw the loading bar, the first thing they did was to click back and go on to another site. My webtrends illuminated this for me. My next step was to go more minimal, which is my favorite thing to do, but then I wondered why I was using Flash at all, because now the motion was mostly gone, and so was the majority of the interactivity. I was using flash simply for the z-index, and I was finding that I could do this with CSS. So, not to be deterred, I did another redesign that kept the motion and interactivity, but minimized the huge bitmap graphics that were giving me the long download times. Instead, I used vector graphics. These were much smaller, but now I had a new problem. If my clients didn't have at least a Pentium 4 running at greater than 2 GHz, my site ran slowly, so slowly that it was almost unusable.

The next issue was that in all the time I had my site, I could never find it using search engines. I discovered that search engines couldn't index my site because they couldn't see through the Flash. To the spider, my site looked like a huge gif in a HTML file with some meta-tags. In other words, it looked like nothing. I tried alt tags, no script tags, etc… but nothing helped. Finally, I decided to design an alternate site for dial-up users using good ol' XHTML and CSS. I found that as soon as I uploaded the file, the search engines had me, and no one ever visited my Flash site anymore.

Suffice it to say that I took my Flash site down. Later, I would redisign my site again so that it would adhere to web standards and could render even faster for all users. That site is this one, and it is the first that I am happy with. I am enjoying some minor success with getting listed on search engines and blog aggregators, and life is good.

I don't hate Flash any more than I hate Allen wrenches or crowbars. It is a tool, and typically you try to use the right tool for the job. It seems to me that many web developers, however are trying to use a sledgehammer to staple two pages together. It just doesn't work. In some cases Flash is OK. In corporate settings, Flash is an excellent tool for presentations, product demonstrations, promotional materials delivered through the company intranet, or from the presenter's local hard drive, as long as it doesn't have to be delivered over the web.

There are a few cases where it is perfectly reasonable for designer / developers to build flash-only web sites for people. Art sites, such as photography showcases can benefit from Flash and its fantastic bitmap compression. Flash photography sites can often download faster than their HTML / CSS counterparts due to smaller image sizes. Some product demonstrations can benefit from Flash and its interactivity. Many cellular phone providers have used Flash to great effect in this regard. Simple branding banners contained within standard HTML / CSS pages with limited motion and interactivity can be excellent, as long as the text of the page is available for the user to read while the Flash is loading.

Still, designers and developers need to ask themselves, what exactly am I trying to do, and who is my target customer? I have had a very hard time making a solid business case for Flash on most of my ecommerce and business sites. Flash, like ColdFusion and Chess, takes only a minute to learn, and can take a lifetime to master. There is a lot to Flash, and a good designer knows how and when to use it to make a site look more professional, or to enhance content that may otherwise appear to be bland. However, beginners seem to tend to develop only in Flash because it addresses many of the apparent problems with XHTML / CSS. Those of browser incompatability, having to learn JavaScript, etc. Someone with limited knowledge of ActionScript and no knowledge of HTML is able to open Flash MX 2004 and create a website. Many designers use Flash exclusively, for this reason.

It seems that XHTML / CSS / JavaScript is having a renaissance. With the proliferation of blog sites, and better browser support of web standards many Flash sites are starting to look tired, and compared with the relative quick response of the HTML sites, many users are deciding to click away from the loading screens in favor of a site with similar content, or products, that is designed in standards compliant XHTML. Not because they love web standards, but because to the user the XHTML site works better and they don't have to wait. I have actually heard designers say that they don't care if dial-up users can't access the site, it has to be beautiful. This thinking is bankrupt, probably 80% of the country is still using dial-up. BroadBand is still frequently ridiculously expensive, and until this changes Flash will be limited to design and car sites mostly, while the bulk of the web is built using XHTML.

I'd actually like to see that change. I'd like to see 3 Mbps synchronous connections standard in every home across the country, and Flash sites loading instantly, but the reality is that it won't happen within the next 5 to 10 years. At least not until garbage cable company decides to charge reasonable rates, and build better fiber backbones, and adequate DNS resources.

In the meantime, I'm quite happy with CSS / XHTML. It does everything I used to do with Flash, but it does it faster and is more accessible. Hopefully more designers will build standards compliant sites, and will realize they can be every bit as beautiful as Flash sites. Check out csszengarden.com to see other great CSS designs.


Yahoo Considered ColdFusion

Posted: December 31st, 1969 | Author: | Filed under: ColdFusion, Programming, Uncategorized | Tags: , | No Comments »

New and Improved MSN Search

Picture of Irv Owens Web DeveloperIt seems that MSN has roughly the same amount of pages indexed as Yahoo and Google, and yet on almost every search they return fewer pages than either of it's contemporaries. I have noticed that MSN's relevancy tends to be pretty good, however it is possible to customize your queries to an extent with MSN with their sliders so you can choose whether you want the most popular results, the most current, or the most relevant via keywords. Also, MSN's search engine is much faster than Yahoo, and a little faster than Google, however this could be due to there being much lighter traffic across Microsoft's servers. But I would attribute the performance to a combination of good programming, and ASP.net.

I dont particularly like ASP.net, mainly because of the lack of a solid framework like struts for java to use. I also dont really like VB syntax, although I have to admit, in version 7 it is greatly improved. But back to searching, if you search for fusebox in Yahoo, you get about 1.1 Million records returned. If you perform the same search in Google, you get about 215,000 records returned. I believe that Google has had a recent shakedown of its index. In the MSN search you get about 245,000. In the Google results you get a lot of art studios, however in the MSN search you get articles about the fusebox framework almost exclusively in the first page of results. Yahoo gives you a mixed bag of results, seemingly alternating back and forth between the fusebox music site, and the fusebox web development framework. In my particular case I was thinking about the fusebox web development framework, but there is no real way for a search engine to know that.

Prior to this week, MSN's search results were pretty useless, Im glad to see that Microsoft is working to do things a little differently. I notice that in my case I have back-links reported in MSN, but they are not listed in Yahoo and Google. Still, I tend to place higher in the SERPS on Yahoo and Google, and often I shouldn't. I think Microsoft is branching out and using different algorithms, instead of checking Google's results and altering their algorithm based on the adjustments to Google's index. That is lame and I think that more search engines should try new things.


Fusebox 4 vs Mach-II

Posted: December 31st, 1969 | Author: | Filed under: ColdFusion, Programming, Uncategorized | Tags: , | No Comments »

Fusebox 4 vs Mach-II

Picture of Irv Owens Web DeveloperIn working with these frameworks for more object oriented code in ColdFusion, I have noticed some interesting facts. It appears that Fusebox 4 is way faster for small applications from an execution standpoint than Mach-II. Mach-II is of course way more robust in terms of near OOP utopia, however a decent level of simulated object-orientation is possible using Fusebox 4.1 if you take advantage of it's ability to natively work with CFCs.

In messing around with the sample applications that are available from the fusebox.org site, I have been modelling some of the speeds in my local development environment. When I tell both that they are in a production environment, their respective speed picks up admirally. If however, they are set to development, they remain quite slow. I would greatly prefer Mach-ii over Fusebox 4.1 for huge applications, as it seems to do much better with object orientation while using CFCs. It's light framework does a much better job than the heavier framework that supports Fusebox 4.1. Mach-ii seems to have been built to specifically work with ColdFusion MX and better, while Fusebox 4 still needs to support ColdFusion 5. This appears to add the extra weight to the runtime. If you want to get as close as you can to true OOP in ColdFusion MX, then Mach-ii is as good as it gets.

fusebox.org


ColdFusion “Scorpio” Possible New Features

Posted: December 31st, 1969 | Author: | Filed under: ColdFusion, Programming, Uncategorized | Tags: , | No Comments »

ColdFusion “Scorpio” Possible New Features

Picture of Irv Owens Web DeveloperOver on Ben Forta's blog, www.forta.com, he has a discussion running about new features for ColdFusion MX 8. One of the things he suggests is tighter integration with Microsoft Exchange. I think that would be very cool, but I'd agree with some of the readers over there that some type of iCal support would be sweet along with the ability to interact with a mail server using IMAP.

I'd like to use the Exchange interaction to allow my applications to use the events for a particular user as a trigger, for example, if a user had an event set up for a particular meeting room using a custom ColdFusion meeting booking system, the server could see if that room were still free about two hours before the meeting and if it weren't, it would send an email to all the meeting participants, in the Outlook format, to reschedule the event or change its location.

That's a really simple way to use it, and I'm sure there are others, but it would be helpful. I would like to see IMAP support so that I wouldn't have to actually pull down a user's mail in order to display it using the cfpop tag. It would be nice to have a customizable mail interface.

What I would really be interested in was an optional built in framework of some type, and upgraded SESSION management. While I don't mind having to use cflock whenever I am using SESSIONs, it would be really cool if I didn't have to use it. I also think that it would make development much easier for those who don't read up as much as I do, fail to use cflock, and end up with large applications with SESSION breakdowns. It might be cool to have another type of shared scope for objects that would automatically check to see if there were an instance of the object. If there was, then the system would use that instance unless told not to. If there were no instance, it would load a new instance from the disk.

Wow, I thought I had no real opinion about the upcoming version of ColdFusion, and that I was pretty happy about its current level of functionality, but I guess there are a couple of suggestions that I could make. More support for Mach-ii and other frameworks via a system level plug-in would be nice. Perhaps if they were more integrated into the application server, they could allow more convention-over-configuration like rails.


New Internet Explorer 7 to Allow More Customization

Posted: December 31st, 1969 | Author: | Filed under: Google, JavaScript, Microsoft, Programming, Uncategorized | Tags: , , , , | No Comments »

New Internet Explorer 7 to Allow More Customization

Picture of Irv Owens Web DeveloperI love the ability I have to add more functionality to Firefox. Right now I have the web developer tools so that I can check out a page's stylesheets, javascript, block level elements, etc… I have the IP tool installed so that I can see the IP address of the site that I am currently visiting. I have the Gmail notifier and the PageRank tool all incorporated in my browser, most of which modifies the status bar at the bottom of the browser and is completely innocuous. Internet Explorer has always supported plug-ins, but they were limited in their ability to change the user's browsing experience, relegating them to toolbars and the like. That is about to change.

Similar to the new Google dashboard Internet Explorer will allow small web applications to be installed in the browser, it will allow a user to modify the webpages they are viewing, create a new download manager using the .net languages, really the implications seem to be pretty huge. There is just one problem. Security.

One of my biggest fears with a heavily extensible Internet Explorer is that people will be able to use it to compromise the security of the operating system. We have heard time and time again that in Longhorn, ahem, Vista, users will be able to run Internet Explorer 7 in a sandbox of sorts, or a least privileged user account, preventing would be hackers from compromising the system. That is great for Vista, but what about on Windows XP Service Pack 2? Don't get me wrong, I think Microsoft has done as much as can be expected of anyone when patching a completely insecure OS, and they did it in record time too. Still, there have been plenty of bulletins regarding more compromises and exploits in Windows XP SP2, some regarding Internet Explorer. If you give individuals the ability to distribute code that a user can install, it is possible, by definition to compromise that user's system. I'm sure that Microsoft would be quick to point out that then it isn't their fault that someone installed software that allowed hackers to have their way with all their files, but at the same time it is very easy to misrepresent a piece of software to a computer novice who is using Windows. Just look at how far Gator / Claria has gotten sneaking software onto systems. I think that while having the ability to customize one's web browser is cool, Microsoft should consider passing on this potential nightmare. It is sort of reminiscent of Microsoft's touting of Active X and how it was going to obliterate the line between desktop software and internet applications and change the way we all use our computers. Well, it changed the way we all use our computers, we all need anti-virus / spyware / malware filters that sniff out those Active X controls and disable them. Most of us, those in the know, if we have to use windows, turn the Active X controls off altogether.

I think that Microsoft should really not include this feature, and I mean even for toolbars unless they are reviewed by Microsoft and signed by Microsoft. That is the only way to be sure users aren't getting malware. If the plug-in isn't signed by Microsoft then the OS should refuse to install it. It should be that simple. Of course it makes developing for IE that much more difficult, but Microsoft could release a developer's version of IE that was open source so that the plug-in verification could be disabled to allow all plug-ins to be installed. Everyone in the software business knows that features move boxes, but Microsoft should keep their eyes on the prize of security. They really need to get their reputation back, and integrating more sketchy features in not the best way to do this.

IE Extensibility – From the IE blog


I Finally Found a Real-World Use For AJAX

Posted: December 31st, 1969 | Author: | Filed under: JavaScript, Programming, Uncategorized | Tags: , , | No Comments »

I Finally Found a Real-World Use For AJAX

Picture of Irv Owens Web DeveloperI'm working on this project now that makes heavy use of standard javascript, Flash, ColdFusion, and HTML. The project is using the TCallFrame javascript function to control the flash movie. Because of the nature of the project, the timing between the movie refresh calls makes using a refreshing iFrame not possible for the text information that I need to display. Likewise, the text needs to be displayed using complicated styles and colors, controlled by ColdFusion components that Flash can't handle easily.

So I was faced with a dilemma. I couldn't refresh an iFrame without throwing the timing of the TCallFrame request, combined with some javascript cookie writing, I didn't write the original application, and Flash remoting calls. Basically, nothing should happen until the cookie is written, which it doesn't, most of the time.

It eventually dawned on me, not only that the application needed to be strengthened with some type of cookie listener at the very least, and a small-scale rewrite at the most, but that I only really needed the application to think that there was no iFrame refresh, but an AJAX call using an invisible iFrame could work.

So I began working on it and it evolved into a two-part system. On one hand, the div that contained the text to be returned from the ColdFusion components needed to be continuously refreshed, which I found out after struggling with another timing issue. Eventually I realized that the variable that needed to be set in my parent window was empty at the time of the screen refresh because the iFrame hadn't finished loading yet.

So what I had to have happen was for the iFrame to make a javascript function call to the parent once the variable was written. Once I had that accomplished it was easy to have the checkboxes that called the TCallFrame javascript call the function to refresh the iFrame. It worked wonderfully, but unfortunately it still caused a timing issue with the main movie. It delayed the writing of the cookie by a hair. Still it was cool to see, that I had an actual use for AJAX.

I have actually found other uses for it, but none as clear cut as that. Flash just wasn't flexible enough. I'm not reversing myself, I still think that Flash should be most developers' first choice when it comes to remoting, but in a pinch AJAX is allright!


Ruby on Rails

Posted: December 31st, 1969 | Author: | Filed under: ColdFusion, Programming, Uncategorized | Tags: , | No Comments »

Ruby on Rails

Picture of Irv Owens Web DeveloperI'm definately suffering from infatuation with another web development language. I'm hesitant to call it love yet because I have been burned so many times before, but I think I love Ruby on Rails on first sight.

For a fully object oriented framework, Ruby on Rails is downright easy. Easier than easy. It also sports a very clean syntax similar to Python in its readability, and the fact that it does almost all database stuff for you is killer. I can see excellent applications for Ruby in prototypes, and perhaps web applications. I still think it needs to be used in enterprise, but it is holding up under some pretty heavy loads right now. I'll be working with it more in the coming days and weeks, as I am very curious as to how it will compare with ColdFusion.

For years I have thought that ColdFusion couldn't be beat for “Rapid Application Development.” But here is an application plus framework that beats it as far as time to market, but also does it in a completely OO way. I have been working to develop my own framework for a couple of days now, and I think that I'll start trying to mimic Rails' functionality for ColdFusion. But the reflection, etc… I don't know if I am up to the task of that.

The other nagging question about Ruby on Rails is how customizable it is as far as if you really want to get down to the nitty gritty. It does a lot of cool high-level stuff for you as far as the database interaction is concerned, but as far as delivering views that comply with XHTML Strict, and ECMA Script standards, I don't know. If I find myself having to rebuild all of the views from scratch it wouldn't be too bad, but I'd rather not.

One other really nice thing out of the many nice things about Ruby on Rails is that it creates nice search engine safe URLs for you, from the start. It truly seems that this language was made to be the web developer's language. It is so young now that to compare it to ColdFusion is almost heresy, but I find myself doing it.

Ruby on Rails


Microsoft IE Developer Toolbar

Posted: December 31st, 1969 | Author: | Filed under: JavaScript, Programming, Uncategorized | Tags: , , | No Comments »

Microsoft IE Developer Toolbar

Picture of Irv Owens Web DeveloperI didn't even know about this and it has been out for about a month. Microsoft has heard the cries from web developers used to using Firefox's developer toolbar extension. While it is often pretty easy to validate your pages using Firefox, see how your block level elements are behaving, and look at the DOM of your page using the Firefox extension, it has been almost impossible with the awful lack of tools for Internet Explorer. They have finally addressed this.

The new IE Developer Toolbar has almost everything that its Firefox adversary has, except for the strong javascript debugger. This is very upsetting especially considering the lame debugging that is built into IE today, but with the relative dearth of tools for internet explorer, anything is welcome.

I have found the toolbar to be extremely useful. The DOM inspector is wonderful in that it highlights the selected item if visible to indicate for which item you are viewing properties. If you have to build applications or websites using Internet Explorer at work, I hope you are designing for Firefox at home, no… I guess you always have to design for Internet Explorer, then you will love the new toolbar. I'd suggest that you download it and install it right away.

IE Developer Toolbar


MySpace.com Switches From ColdFusion to Blue Dragon

Posted: December 31st, 1969 | Author: | Filed under: ColdFusion, Microsoft, Programming, Uncategorized | Tags: , , | 1 Comment »

MySpace.com Switches From ColdFusion to Blue Dragon

Picture of Irv Owens Web DeveloperWhen MySpace decided to stop using ColdFusion recently, many ColdFusion developers felt somewhat betrayed by the change. Many even suggested that it wasn't the best engineered solution. By that they were hinting that by using fusebox, no one has said which version, and ColdFusion 4.5 / 5 they weren't working with the best that Macromedia had to offer.

New Atlanta claims in their press release that using the exact same code, MySpace was able to reduce their CPU usage by 50% under heavy load. They also claim that this result could not be duplicated with ColdFusion MX. I believe both of these claims. Most ColdFusion developers are loathe to admit it, but Microsoft has a pretty good thing going with C# right now. The ASP.net framework is decent, it performs extremely well in every test I have seen, so I am not suprised that by using ADO.net and ASP.net they were seeing gains like this. The biggest problem with any scripting or programming language comes down to the drivers when using an external resource. Web development is no different. When your database connection pool reaches it's limit, it just can't create any more connections and requests get queued. There is no way around this except to get better database drivers. I have seen JDBC fail miserably time and time again, especially with SQL Server 2000 in this area. One of the biggest causes of that 100% CPU utilization seems to be in the JDBC driver when the database doesn't respond in a timely fashion. I don't know what causes it, but it happens when I am working with a complicated dataset. It isn't even that the memory usage is too high and the server is thrashing, the CPU just goes to max and starts refusing connections. The only solution to this is to kill and restart the JRun instance. After that it behaves well again until it crashes.

In all fariness to Java / J2EE, I have only experienced these issues while working with ColdFusion Enterprise on Windows based systems, this doesn't seem to happen on Linux, at least in my experience. Since MySpace was so heavily invested in both ColdFusion and Windows hardware, I guess they had no choice but to use New Atlanta's Blue Dragon. Still, what most programmers have to realize is that at the end of the day, it is the tool that delivers the best that will be used. No matter what we feel about Microsoft, ASP.net is fast and stable in it's newest iteration. One of the advantages to ASP.net is that it automatically fixes it's memory leaks. This is something that Macromedia desperately needs to build into JRun. ColdFusion is sometimes slow and is often buggy when dealing with some of it's advanced features. Experienced CF developers know how to deal with most of this so it doesn't come into play very often, and I'd bet that with higher quality Microsoft SQL Server JDBC drivers, and the application of good design patterns and reusable CFCs they could have gotten better results out of the CFMX server. But as the CEO of New Atlanta said in his blog, to rewrite all the code to take advantage of components, invocation, and var typed variables is beside the point. They made the decision that would best serve their business. If their code was reusable or not is immaterial after the fact.

Still, I find ColdFusion's performance to be reasonable. I wouldn't call JSP / ColdFusion a speed demon any day, with light load, PHP blows it away with 10 users on it, but once you scale that up to 100,000 users concurrently, then Java starts to shine. Since Microsoft shamelessly copied Java with C# and improved on it, it is no suprise that ASP.net performs as well as it does since it has native OS support in Windows Server. No one uses ColdFusion because it is the fastest from the execution standpoint, they use it because it is the fastest language to develop in.

Another interesting point would be if Microsoft were to acquire New Atlanta in order to integrate ColdFusion support directly into IIS. This would give Macromedia / Adobe some competition and force them to fix some of the issues they have let languish in CF. It wouldn't be too suprising a move since they are seriously evaluating building PHP support directly into IIS. I'll bet that it wasn't even that tough for New Atlanta to port their J2EE version of ColdFusion over to ASP.net due to it's support for C# and Microsoft's Java source to C# source conversion tools. It, of course required some optimization, I'm sure, but I'll bet it is smokin'. Maybe I'll download it and try it.

New Atlanta
New Atlanta CEO's blog
House of Fusion MySpace Conversion Discussion