| By Yakov Fain | Article Rating: |
|
| March 27, 2012 08:00 AM EDT | Reads: |
5,086 |
Design patterns were not born equal. Some of them are boring, while others are special. Do you remember your feelings after learning what the Data Transfer Object is? Don’t remember? Of course – cause you didn’t have any special feelings about it other than “It’s easy”.
What do you say about Singleton? Yeah, this is kinda interesting pattern which gave you something to talk about. Do we really need it? Can’t we just achieve the same effect with static variables? Does it make your entire application tightly coupled? Lots to discuss and share your opinion in online forums.
How about Visitor? You must have remembered those feelings when you ran into it first time. The day when you understood how the Visitor pattern works was crucial in your career – that was the moment when you realized that you were not junior software developer anymore. From that very moment you can consider yourself a mid-level person. Till when? Till you’ll be able to explain the Visitor pattern to at least three juniors. Continuos Explanation (c) might reveal though that Visitor is not exactly what you originally thought it was, but now you really get it!
But there is one pattern that has a very strange effect on people. It’s called Dependency Injection. Decoupling in action! A Customer class doesn’t need to reach out for its Orders! How cool is that! First, it gets you high just like smoking banana peels. Then it makes you a little depressed when you realize that there is always a price to pay – instead of having two simple classes Customer and Order you need to have an Inversion of Control container and should neverforget to properly annotate the injector and injectee. In the server-side Java, containers are not too bad, really. We are used to them and feel pretty comfy inside.
But then, a senior Java developer starts learning other domain-specific programming languages like ActionScript or JavaScript just to realize that these poor people don’t have any IoC containers yet! Can you believe that? This is when the Java developer gets craving to make the lives of those (not as fortunate) ActionScript or JavaScript developers easier. In other words, such DI addict wants to share the needle with the rest of the world and inject, inject, inject… This results in proliferation of the “lightweight” DI frameworks/IoC containers among UI developers, which they should be using on top of whatever framework you currently use. This will overcomplicate the application design, but will allow you to inject Orders into Customers rather than using this so-nineties-getOrders().
Oh well, why did I pour all this on you? I don’t know. But please don’t try to tell this to people who enjoy living in thes IoC worlds or else they’ll become aggressive again and will make you feel stupid for not realizing that one can’t do a proper unit testing without the DI. Do we need unit testing? OK, OK….I won’t even go there.
Published March 27, 2012 Reads 5,086
Copyright © 2012 SYS-CON Media, Inc. — All Rights Reserved.
Syndicated stories and blog feeds, all rights reserved by the author.
More Stories By Yakov Fain
Yakov Fain is a Managing Director of Farata Systems, consulting, training and product company. He has authored several Java books, dozens of technical articles. SYS-CON Books released his latest co-authored book , Rich Internet Applications with Adobe Flex and Java: Secrets of the Masters in Spring 2007. Sun Microsystems has nominated and awarded Yakov with the title Java Champion. He leads the Princeton Java Users Group. He is an Adobe Certified Flex Instructor. Yakov co-athored the O'Reilly book "Enterprise Application Development with Flex". He twits at twitter.com/yfain.
- Cloud People: A Who's Who of Cloud Computing
- AMD and Adobe Collaborate on Upcoming Version of Adobe Premiere Pro Software to Enable Breakthrough Video Editing Performance Through Open Standards
- New Relic Q1 2013 Blazes Past Growth Targets and Reaches 40,000 Active Customer Accounts
- Apple Makes Highly Eccentric Hire
- Cloud Business Solutions, Social Media, and Platform Systems of Engagement Market Shares, Strategies, and Forecasts, Worldwide, 2013 to 2019
- Interop Las Vegas Previews News Announcements from over 60 Exhibitors & Sponsors
- ExtraHop Named a Best of Interop 2013 Finalist for Two Awards: Best Cloud and Virtualization Product and Best Monitoring and Management Product
- BrightScope Releases Top 25 Technology Companies With the Best 401k Plans
- Adobe Drives Innovation With New Video Workflows at NAB 2013
- Research and Markets: Cloud Business Solutions, Social Media, and Platform Systems of Engagement
- Prompt Communications launches Prompt-Ed technical training series spearheaded by hands-on WordPress weekend workshops
- This Week in Cloud, May 9, 2013: U.K. issues cloud-first policy, Dell acquires Enstratius, OpenStack’s growing pains. And more…
- Cloud People: A Who's Who of Cloud Computing
- AMD and Adobe Collaborate on Upcoming Version of Adobe Premiere Pro Software to Enable Breakthrough Video Editing Performance Through Open Standards
- New Relic Q1 2013 Blazes Past Growth Targets and Reaches 40,000 Active Customer Accounts
- Microsoft Surface Pro Tablet Latest Example of Staples Meeting Technology Needs of Small Business
- Apple Makes Highly Eccentric Hire
- Cloud Business Solutions, Social Media, and Platform Systems of Engagement Market Shares, Strategies, and Forecasts, Worldwide, 2013 to 2019
- Global eLEARNING Industry
- Defense Intelligence Worldwide Conference: Bring your disruptive technology to DIA leaders
- Interop Las Vegas Previews News Announcements from over 60 Exhibitors & Sponsors
- How to Get Full Value in a Flash Upgrade
- SMAC News Weekly – Week of March 10, 2013
- Top Web Application Security Questions to Ask Third Party Developers
- Where Are RIA Technologies Headed in 2008?
- Cover Story: How to Increase the Frame Rates of Your Flash Movies
- AJAX World RIA Conference & Expo Kicks Off in New York City
- Your First Adobe Flex Application with a ColdFusion Backend
- Adobe Flex 2: Advanced DataGrid
- How To Create a Photo Slide Show ...
- i-Technology Blog: Death-Knell For "Rich Media? Hardly!
- Personal Branding Checklist
- Adobe Flex Interface Customization - Themes, Styles, Skins
- Adobe/Macromedia - Microsoft, Look Out!
- Has the Technology Bounceback Begun?
- "Real-World Flex" by Adobe's Christophe Coenraets

























