Inversion of Control Rocks
Inversion of Control Rocks
By: Paul Hammant
Dec. 4, 2003 12:00 AM
Inversion of Control (IoC) is about software components doing what they are told, when they are told. Your OO application could well become unmaintainable without it.
IoC is a pattern that helps teams avoid the dependency hell that results when an application grows into a large pseudo-platform without taking care to adequately decouple logic; that thing that ultimately only a couple of its omnipotent architects or old-lag premium-rate contractors really understand; that system that Heath Robinson and Rube Goldberg might have made together (look them up).
The problem with small working applications that become large is that static-method entanglement does not scale. One part of a system that's otherwise fairly self-contained statically accesses another part of the system and cannot be instantiated without invoking methods in the latter. Thus it can't easily be isolated for unit testing. What's more, it can't be developed as an independent component. Components that are developed separately can have their own development teams and may well be part of a larger design. These components will have their own source control directory and can be developed against mock implementations of their dependent components. All this will help overall development become faster, in terms of both the team's efficiency and the build time.
As an example, let's take a Personal Information Manager (PIM) application that has UI and persistence elements. The naïve implementation might have inline JDBC statements among graphical code. A componentized application would have that persistence logic separated into a persistence component with user interface logic enshrined in a view-controller component. Clearly, if the two teams developing their respective components agree on a slowly evolving interface/implementation-separated API for persistence, they can develop at their own pace and ship versions of their components whenever it's appropriate.
A third piece, which is not a component, would be the bootstrap for the application. That bootstrap may well be entirely contained in a static main method of a simple class and would merely instantiate the two components, passing one into the other's constructor before invoking setVisible(true) or similar. With the introduction of this bootstrap we can see the control aspect of the IoC pattern.
In a noncomponentized version of our example, the view-controller may well have its own main method, might instantiate a fixed version of the PIM store, or access it via an unnecessary singleton factory (public static methods are generally bad), i.e., the control is very much inside the component in question.
The word "inversion" from the pattern name is about getting control back. The containing application (often a true container or a proper framework rather than a main method) controls when a component is instantiated and which implementations of its dependent components it is passed.
IoC also dictates the configuration of components. A JDBC version of the PIM store above would clearly require some JDBC settings. Classically, developers may write a mechanism to retrieve them from a fixed properties file. IoC would insist that the configuration is passed into the component. In our hypothetical example, it would take it via the constructor and be interface/implementation separated. Thus the configuration is a component. It would be tightly coupled to the component that requires it, but subject to multiple implementations, one of which may be the "from properties file".
Inversion of Control has moved to the center stage in the last six months after a five-year gestation period. There are three types of Inversion of Control. Type 1 uses configuration data (Avalon, JContainer); Type 2 uses bean introspection (Spring Framework, WebWork2, HiveMind); Type 3 uses constructor signatures (PicoContainer).
For a componentized system that uses singletons or similar for component resolution, the dependency is obscure. In IoC it is declarative. The application would have loosely coupled components and be more scalable, more maintainable, and more testable. It's a very small investment for a very large return. Inversion of Control rocks.
Reader Feedback: Page 1 of 1
Virtualization Articles & Feature Stories
Latest Virtualization Conference News
Best Recent Articles on Cloud Computing & Big Data Topics
The Arlington, Virginia-based National Science Foundation has just released its "Report on Support for Cloud Computing" - in response to the America Competes Reauthorization Act of 2010, Section 524. It is an absolute must-read for all concerned with current and future research projects in Cloud Computing.
"The volume of data we're generating now from machines pales in comparison to the volume of data we'll soon generate from our own bodies," says data security expert Dave Asprey. Writing in a Trend Micro blog, Asprey - who is one of the leaders in the emerging Quantified Self movement - explains his vision of a world in which personal biometrical data is shared via the cloud.
Cloud computing has caught the attention of business leaders around the world in every industry because of its enormous transformative potential. Visionary companies know that the value of the cloud is far greater than the current focus solely on technology and operating costs: when combined with a collaborative approach to designing processes, cloud computing will change how we do business.
Want to make sense of the hottest new concept in Enterprise IT? Want to understand in just hours what experts have spent many hundreds of days deciphering? Cloud computing is a technology that has rapidly evolving peppered with a lot of hype along the way. Customers find it hard to navigate through this and make sense of what aspects of this technology will give them real business benefit. Cloud Computing Bootcamp, led by our 2013 Bootcamp Instructor Larry Carvalho, is a great way to get a practical understanding of this technology. We offer multiple days of actionable insight into what vendor offerings are currently available and help you comprehend their strategy. The ever-popular Bootcamp, which is now held regularly around the world, is being held in conjunction with the 12th Cloud Expo, June 10-13, 2013, at the Javits Center, New York, NY.
Did you know that ninety percent of the data in the world has been created in the last two years? Every day, we create 2.5 quintillion (or 2.518) bytes of data, according to IBM. As corporations across all industries globally are struggling with how to retain, aggregate and analyze this mounting volume of what the industry refers to as Big Data, it also provides a unique opportunity for innovative startups that recognize the business prospects Big Data presents. Big Data is not just unlocking new information but new sources of economic and business value. Interactivity is driving Big Data, with people and machines both consuming and creating it. Digital companies focused on becoming good at aggregating and analyzing the data created by the end users of their product, who then provide their customers with solid insights taken from that data are at a distinct competitive advantage over others in the marketplace.
Industry-specific clouds are those PaaS, IaaS, and PaaS services that are tailored for a specific vertical, such as transportation, retail, finance, and health care. IDC sees a $65 billion market in these industry solutions for 2013, rising to $100 billion in 2016. The value of industry-specific clouds is that businesses within a vertical can connect to applications, processes, and databases that are pre-defined for that vertical within a public or private cloud. They can extend processes and databases into the business domain, versus defining the data and processes within a generic cloud-based platform. So, are industry specific clouds right for your business? What options are out there? How do you figure out the ROI?
SYS-CON Events announced today that Rackspace Hosting, the open cloud company, has been named "Platinum Plus Sponsor" of SYS-CON's 12th International Cloud Expo, which will take place on June 10-13, 2013, at the Javits Center in New York City, New York. Rackspace® Hosting (NYSE: RAX) is the open cloud company, delivering open technologies and powering more than 205,000 customers worldwide. Rackspace provides its renowned Fanatical Support® across a broad portfolio of IT products, including Public Cloud, Private Cloud, Hybrid Hosting and Dedicated Hosting. Rackspace has been recognized by Bloomberg BusinessWeek as a Top 100 Performing Technology Company, is featured on Fortune's list of 100 Best Companies to Work For and is included on the Dow Jones Sustainability Index. Rackspace was positioned in the Leaders Quadrant by Gartner Inc. in the "2011 Magic Quadrant for Managed Hosting." Rackspace is headquartered in San Antonio with offices and data centers around the world.
10th International Cloud Expo, held on June 11-14, 2012 at the Javits Center in New York City, featured four content-packed days with a rich array of sessions about the business and technical value of cloud computing led by exceptional speakers from every sector of the cloud computing ecosystem. The Cloud Expo series is the fastest-growing Enterprise IT event in the past 10 years, devoted to every aspect of delivering massively scalable enterprise IT as a service. We invite you to enjoy our photo album of the show - we'll be adding new images all week.
Ulitzer.com announced "the World's 30 most influential Cloud bloggers," who collectively generated more than 24 million Ulitzer page views. Ulitzer's annual "most influential Cloud bloggers" list was announced at Cloud Expo, which drew more delegates than all other Cloud-related events put together worldwide. "The world's 50 most influential Cloud bloggers 2010" list will be announced at the Cloud Expo 2010 East, which will take place April 19-21, 2010, at the Jacob Javitz Convention Center, in New York City, with more than 5,000 expected to attend.
Cloud computing is becoming one of the next industry buzz words. It joins the ranks of terms including: grid computing, utility computing, virtualization, clustering, etc. Cloud computing overlaps some of the concepts of distributed, grid and utility computing, however it does have its own meaning if contextually used correctly. The conceptual overlap is partly due to technology changes, usages and implementations over the years. Trends in usage of the terms from Google searches shows Cloud Computing is a relatively new term introduced in the past year. There has also been a decline in general interest of Grid, Utility and Distributed computing. Likely they will be around in usage for quit a while to come. But Cloud computing has become the new buzz word driven largely by marketing and service offerings from big corporate players like Google, IBM and Amazon.
SYS-CON Events announced today that Dell Inc. has been named "Silver Sponsor" of SYS-CON's 12th International Cloud Expo, which will take place on June 10-13, 2013, at the Javits Center in New York City, New York. For more than 28 years, Dell has empowered countries, communities, customers and people everywhere to use technology to realize their dreams. Customers trust Dell to deliver technology solutions that help them do and achieve more, whether they're at home, work, school or anywhere in their world. Learn more about Dell's story, purpose and people behind its customer-centric approach.
One of the most compelling promises of the cloud is that you can pull out a credit card and be working in minutes. No purchase orders to fill out, no equipment to wait for on the loading dock. Just instant access to the resources you need, when you need them. But accessibility comes at a price, and an unintentional consequence may be that you create yet another orphaned identity silo. Enterprise IT has spent years consolidating its mishmash of directories, only to discover that cloud now threatens to turn back their hard-won victories. In his session at the 12th International Cloud Expo, Scott Morrison, CTO and Chief Architect at Layer 7 Technologies, will look at strategies to incorporate identity into cloud applications. Enterprise identity or social login can both be a part of your go-to-cloud strategy, but you must plan for this upfront, rather than try to retrofit identity and access control at a later date.
Cloud Expo, Cloud Expo East, Cloud Expo West, Cloud Expo Silicon Valley, Cloud Expo Europe, Cloud Expo Tokyo, Cloud Expo Prague, Cloud Expo Hong Kong, Cloud Expo Sao Paolo are trademarks and /or registered trademarks (USPTO serial number 85009040) of Cloud Expo, Inc.
Virtualization Blogs Live