|By Pete Whitney||
|August 10, 2005 12:00 PM EDT||
Experienced developers know many of the benefits of and motivations for using interface-based design principles. Interfaces provide for polymorphic behavior by hiding the implementation and only exposing the relevant public methods of the implementing class. What may be less appreciated is that the use of interfaces, when applied to an entire application, can provide for application isolation, while at the same time enhancing testing capabilities.
In this article we'll explore the use of interfaces at all application boundaries and gain an appreciation for why we should consider, and possibly even mandate, interface-based design principles at all application boundaries. This mandate should apply even if application requirements or application design do not call for differing behavior behind the interface.
What Is an Application Boundary?
Before we start mandating anything throughout our entire application, it would be helpful to have a better feel for exactly what an application boundary is. Consider any application you write. The application is composed of the classes that you write and the code or resources with which your application interacts. Unless you're writing an "Hello World" application, you will need to access many or all of the following resources:
- File system, library, server, database...
Motivations for Interfaces
While many motivations drive the use of interfaces, it is instructive to describe the core motivations. As one example, consider JDBC, which makes heavy use of interface-based design principles. A ResultSet is an interface; moreover, all JDBC driver vendors must provide an implementation for the ResultSet interface. Application developers simply use the ResultSet, in most instances not knowing or caring how the underlying code is implemented. Application developers code to the ResultSet interface while the actual implementation is usually defined and configured apart from the application code. JDBC is based heavily on interfaces to support the ability to change the driver implementation without impacting the application code. Simply put, portability is the driving factor for JDBC interfaces.
Resource wrapping can be listed as a second motivation for the use of interfaces. The main intent is to support the ability to change the wrapped resource with little to no application code changes. In this sense, the motivations for resource wrapping are very similar to the JDBC example except that most resources are not based on a set of predefined interfaces as JDBC is. By contrast, different resources that deliver the same or similar functionality are not likely to have the same API. As a result, the interface for a changed resource is likely to become more of a façade-based implementation, especially if a resource change is realized.
Other application interfaces are typically chosen for the polymorphic benefits realized by an interface-based design. The application behavior is mandated by either specific requirements or by design recognizing the similarities between two or more subsystems or elements. On the application side, interface-based solutions are nearly always chosen based on required or desired application behavior with polymorphism being the driving motivation.
Lastly, application isolation should be added as another motivation for the use of interfaces. The intent of application isolation is not necessarily to support the future change of a tool or resource, but rather to support the ability to remove the resource dependency from an application. Isolation is often needed during unit testing, but is also beneficial in the early stages of development when the resource in question may not yet be available. Using interfaces at all application boundaries delivers the ability to easily plug in alternative implementations that are not resource dependant. This capability can deliver extensive benefits to a development team by eliminating the constraints imposed by some resource dependencies.
For brevity, the motivations for interface-based design are:
- Resource wrapping
- Application isolation
Application isolation is the motivation we'll spend the remainder of this article on. With that thought in mind, let's turn to the impact of external resources on our application code base. For better understanding we'll use the retrieval of a collection of person objects from a database as our core example. In iteration 1 we'll provide an unimproved implementation. This iteration shows a small cut of the code as it might exist without the use of interface-based design principles. Using good design principles we'll encapsulate our database access by using a PersonDAO class (Data Access Object pattern) for all database access. Figure 2 shows the UML for our simplified application.
The PersonDAO class will acquire a database connection and issue queries on behalf of the invoking party, which in this instance is the BusinessFacade class (Façade Pattern). The code below shows a brief implementation of the BusinessFacade class. Note the direct instantiation and use of the PersonDAO class, which immediately ties the BusinessFacade class to the database resources referenced in the PersonDAO class.
1 public class BusinessFacade
3 public void
6 Date today = new Date();
7 PersonDAO personDao =
8 new PersonDAO();
9 Collection persons =
11 // Do what needs to be done
12 // to report on those that
13 // have birthdays today.
Being tied to the database imposes all of the following resource requirements:
- Existing network connectivity
- Database server capable of handling the connection request
- Database schema supporting the Person table
- Database data from which the query can be fulfilled
You have great SaaS business app ideas. You want to turn your idea quickly into a functional and engaging proof of concept. You need to be able to modify it to meet customers' needs, and you need to deliver a complete and secure SaaS application. How could you achieve all the above and yet avoid unforeseen IT requirements that add unnecessary cost and complexity? You also want your app to be responsive in any device at any time. In his session at 19th Cloud Expo, Mark Allen, General Manager of...
Jan. 18, 2017 07:30 PM EST Reads: 3,136
WebRTC is bringing significant change to the communications landscape that will bridge the worlds of web and telephony, making the Internet the new standard for communications. Cloud9 took the road less traveled and used WebRTC to create a downloadable enterprise-grade communications platform that is changing the communication dynamic in the financial sector. In his session at @ThingsExpo, Leo Papadopoulos, CTO of Cloud9, discussed the importance of WebRTC and how it enables companies to focus o...
Jan. 18, 2017 06:15 PM EST Reads: 4,185
Big Data engines are powering a lot of service businesses right now. Data is collected from users from wearable technologies, web behaviors, purchase behavior as well as several arbitrary data points we’d never think of. The demand for faster and bigger engines to crunch and serve up the data to services is growing exponentially. You see a LOT of correlation between “Cloud” and “Big Data” but on Big Data and “Hybrid,” where hybrid hosting is the sanest approach to the Big Data Infrastructure pro...
Jan. 18, 2017 05:30 PM EST Reads: 4,867
In his General Session at 16th Cloud Expo, David Shacochis, host of The Hybrid IT Files podcast and Vice President at CenturyLink, investigated three key trends of the “gigabit economy" though the story of a Fortune 500 communications company in transformation. Narrating how multi-modal hybrid IT, service automation, and agile delivery all intersect, he will cover the role of storytelling and empathy in achieving strategic alignment between the enterprise and its information technology.
Jan. 18, 2017 04:45 PM EST Reads: 4,577
Buzzword alert: Microservices and IoT at a DevOps conference? What could possibly go wrong? In this Power Panel at DevOps Summit, moderated by Jason Bloomberg, the leading expert on architecting agility for the enterprise and president of Intellyx, panelists peeled away the buzz and discuss the important architectural principles behind implementing IoT solutions for the enterprise. As remote IoT devices and sensors become increasingly intelligent, they become part of our distributed cloud enviro...
Jan. 18, 2017 04:30 PM EST Reads: 4,757
With major technology companies and startups seriously embracing IoT strategies, now is the perfect time to attend @ThingsExpo 2016 in New York. Learn what is going on, contribute to the discussions, and ensure that your enterprise is as "IoT-Ready" as it can be! Internet of @ThingsExpo, taking place June 6-8, 2017, at the Javits Center in New York City, New York, is co-located with 20th Cloud Expo and will feature technical sessions from a rock star conference faculty and the leading industry p...
Jan. 18, 2017 03:30 PM EST Reads: 3,682
"LinearHub provides smart video conferencing, which is the Roundee service, and we archive all the video conferences and we also provide the transcript," stated Sunghyuk Kim, CEO of LinearHub, in this SYS-CON.tv interview at @ThingsExpo, held November 1-3, 2016, at the Santa Clara Convention Center in Santa Clara, CA.
Jan. 18, 2017 02:45 PM EST Reads: 1,591
Things are changing so quickly in IoT that it would take a wizard to predict which ecosystem will gain the most traction. In order for IoT to reach its potential, smart devices must be able to work together. Today, there are a slew of interoperability standards being promoted by big names to make this happen: HomeKit, Brillo and Alljoyn. In his session at @ThingsExpo, Adam Justice, vice president and general manager of Grid Connect, will review what happens when smart devices don’t work togethe...
Jan. 18, 2017 02:00 PM EST Reads: 402
"There's a growing demand from users for things to be faster. When you think about all the transactions or interactions users will have with your product and everything that is between those transactions and interactions - what drives us at Catchpoint Systems is the idea to measure that and to analyze it," explained Leo Vasiliou, Director of Web Performance Engineering at Catchpoint Systems, in this SYS-CON.tv interview at 18th Cloud Expo, held June 7-9, 2016, at the Javits Center in New York Ci...
Jan. 18, 2017 01:00 PM EST Reads: 5,604
The 20th International Cloud Expo has announced that its Call for Papers is open. Cloud Expo, to be held June 6-8, 2017, at the Javits Center in New York City, brings together Cloud Computing, Big Data, Internet of Things, DevOps, Containers, Microservices and WebRTC to one location. With cloud computing driving a higher percentage of enterprise IT budgets every year, it becomes increasingly important to plant your flag in this fast-expanding business opportunity. Submit your speaking proposal ...
Jan. 18, 2017 01:00 PM EST Reads: 5,102
Discover top technologies and tools all under one roof at April 24–28, 2017, at the Westin San Diego in San Diego, CA. Explore the Mobile Dev + Test and IoT Dev + Test Expo and enjoy all of these unique opportunities: The latest solutions, technologies, and tools in mobile or IoT software development and testing. Meet one-on-one with representatives from some of today's most innovative organizations
Jan. 18, 2017 12:15 PM EST Reads: 1,542
20th Cloud Expo, taking place June 6-8, 2017, at the Javits Center in New York City, NY, will feature technical sessions from a rock star conference faculty and the leading industry players in the world. Cloud computing is now being embraced by a majority of enterprises of all sizes. Yesterday's debate about public vs. private has transformed into the reality of hybrid cloud: a recent survey shows that 74% of enterprises have a hybrid cloud strategy.
Jan. 18, 2017 12:00 PM EST Reads: 4,231
SYS-CON Events announced today that Super Micro Computer, Inc., a global leader in Embedded and IoT solutions, will exhibit at SYS-CON's 20th International Cloud Expo®, which will take place on June 7-9, 2017, at the Javits Center in New York City, NY. Supermicro (NASDAQ: SMCI), the leading innovator in high-performance, high-efficiency server technology, is a premier provider of advanced server Building Block Solutions® for Data Center, Cloud Computing, Enterprise IT, Hadoop/Big Data, HPC and E...
Jan. 18, 2017 12:00 PM EST Reads: 5,762
SYS-CON Events announced today that Linux Academy, the foremost online Linux and cloud training platform and community, will exhibit at SYS-CON's 20th International Cloud Expo®, which will take place on June 6-8, 2017, at the Javits Center in New York City, NY. Linux Academy was founded on the belief that providing high-quality, in-depth training should be available at an affordable price. Industry leaders in quality training, provided services, and student certification passes, its goal is to c...
Jan. 18, 2017 12:00 PM EST Reads: 1,949
WebRTC is the future of browser-to-browser communications, and continues to make inroads into the traditional, difficult, plug-in web communications world. The 6th WebRTC Summit continues our tradition of delivering the latest and greatest presentations within the world of WebRTC. Topics include voice calling, video chat, P2P file sharing, and use cases that have already leveraged the power and convenience of WebRTC.
Jan. 18, 2017 10:30 AM EST Reads: 3,109
"Matrix is an ambitious open standard and implementation that's set up to break down the fragmentation problems that exist in IP messaging and VoIP communication," explained John Woolf, Technical Evangelist at Matrix, in this SYS-CON.tv interview at @ThingsExpo, held Nov 4–6, 2014, at the Santa Clara Convention Center in Santa Clara, CA.
Jan. 18, 2017 09:45 AM EST Reads: 11,557
WebRTC sits at the intersection between VoIP and the Web. As such, it poses some interesting challenges for those developing services on top of it, but also for those who need to test and monitor these services. In his session at WebRTC Summit, Tsahi Levent-Levi, co-founder of testRTC, reviewed the various challenges posed by WebRTC when it comes to testing and monitoring and on ways to overcome them.
Jan. 18, 2017 08:15 AM EST Reads: 5,984
"A lot of times people will come to us and have a very diverse set of requirements or very customized need and we'll help them to implement it in a fashion that you can't just buy off of the shelf," explained Nick Rose, CTO of Enzu, in this SYS-CON.tv interview at 18th Cloud Expo, held June 7-9, 2016, at the Javits Center in New York City, NY.
Jan. 18, 2017 07:45 AM EST Reads: 4,641
DevOps is being widely accepted (if not fully adopted) as essential in enterprise IT. But as Enterprise DevOps gains maturity, expands scope, and increases velocity, the need for data-driven decisions across teams becomes more acute. DevOps teams in any modern business must wrangle the ‘digital exhaust’ from the delivery toolchain, "pervasive" and "cognitive" computing, APIs and services, mobile devices and applications, the Internet of Things, and now even blockchain. In this power panel at @...
Jan. 18, 2017 06:45 AM EST Reads: 2,774
Every successful software product evolves from an idea to an enterprise system. Notably, the same way is passed by the product owner's company. In his session at 20th Cloud Expo, Oleg Lola, CEO of MobiDev, will provide a generalized overview of the evolution of a software product, the product owner, the needs that arise at various stages of this process, and the value brought by a software development partner to the product owner as a response to these needs.
Jan. 18, 2017 06:30 AM EST Reads: 1,190