|By Dan North||
|March 5, 2004 12:00 AM EST||
The vast majority of Java enterprise applications are architected along the lines of Sun's original PetStore showcase application. Rather than seeing this as a market stall displaying all the J2EE goods on offer, developers took it as a blueprint for enterprise applications. It certainly created a lot of work for Java application developers (as well as systems administrators and systems integrators), but whether most of the applications needed most of the possible layers - including bean-managed persistence and the ubiquitous DAO - is open for question at the very least. This article briefly describes some of the testability shortcomings of the traditional J2EE model and presents some alternatives.
The J2EE Model
With J2EE we are tied to a single logical server in a client/server architecture, and any component such as a servlet or EJB has to be deployed to the server (potentially a time-consuming process) before we know whether it works. This makes it difficult to use test-driven techniques to develop these components. To make a small change to such a component requires a code change, a recompile, and a redeploy. On many commercial application servers this sequence of events takes too long to be repeated as frequently as TDD requires. The developer is encouraged to deploy bigger changes less often, and therefore has a higher risk of introducing errors.
A few patterns alleviate some of this, most notably the Front Controller/Dispatcher pattern. This has a single component (a servlet in the Web container or a stateless session bean in the EJB tier) that dispatches requests to a POJO (Plain Old Java Object). A POJO is much better suited for unit testing - we can simply instantiate it in a known state and then exercise its behavior. From a TDD perspective, this is what makes a framework like WebWork more "agile" than Struts; for instance, the actual components are testable outside of a container.
J2EE encourages us to model a system in terms of components interacting with one another. Instead we can model in terms of services that an application provides or "things that it does." These services can exist on different machines or in different virtual machines on the same host. As long as we have a means of locating a service, we can use it. In terms of testability, this makes life a lot easier for us. A service is simply a class that implements an interface, so we can test its behavior in isolation or in conjunction with other services just by instantiating a service object and calling methods on it.
Service-oriented mechanisms such as SOAP, XML-RPC, or JINI are cleanly separated from the actual services they advertise. Compare this to a session bean, which is tightly coupled to its container: it requires a number of container-specific classes just to function (such as a javax.ejb. SessionContext), and has a whole complex life cycle associated with it. Both of these make testing a session bean a lot more complex - and add greatly to the time it takes to make a change and test it.
So far we have focused on synchronous behavior. The concept of modeling a system in terms of messages or events being produced and consumed asynchronously from queues is very powerful and yet still largely overlooked. Event-driven systems are renowned for their resilience, but they also lend themselves very nicely to a test-driven approach. As with services, an event consumer or listener is typically a Java class that implements an interface. As long as the consumer class is decoupled from the delivery mechanism, we can easily test its behavior. We can model synchronous behavior asynchronously to gain both scalability and testability. A Staged, Event-Driven Architecture (SEDA) simulates synchronous processing by means of a series of stages, each represented by a queue. Thus each stage can be unit-tested and developed separately.
When you're writing an enterprise application in Java, you shouldn't feel constrained to the classic J2EE model. Investigate some of the alternatives; ask lots of questions; and evaluate the costs, benefits, and risks of using a different approach. But most important, as a developer try to find an architecture that enables you to write testable code. Remember, PetStore is a showcase of technologies, not a blueprint.
|Tom 03/10/04 12:44:18 AM EST|
I agree on the statements made here. Personally I use the approach of moving all logic into POJO''s, which have no knowledge of how their functionality is made public. The servlet or EJB or webservice doing that, is just a hand-through taking care of the appropriate protocol.
|Tom 03/10/04 12:43:24 AM EST|
I agree on the statements made here. Personally I use the approach of moving all logic into POJO''s, which have no knowledge of how their functionality is made public. The servlet or EJB or webserver doing that, is just a hand-through taking care data of the appropriate protocol.
The recent trends like cloud computing, social, mobile and Internet of Things are forcing enterprises to modernize in order to compete in the competitive globalized markets. However, enterprises are approaching newer technologies with a more silo-ed way, gaining only sub optimal benefits. The Modern Enterprise model is presented as a newer way to think of enterprise IT, which takes a more holistic approach to embracing modern technologies.
May. 25, 2015 11:00 PM EDT Reads: 6,190
The true value of the Internet of Things (IoT) lies not just in the data, but through the services that protect the data, perform the analysis and present findings in a usable way. With many IoT elements rooted in traditional IT components, Big Data and IoT isn’t just a play for enterprise. In fact, the IoT presents SMBs with the prospect of launching entirely new activities and exploring innovative areas. CompTIA research identifies several areas where IoT is expected to have the greatest impact.
May. 25, 2015 09:00 PM EDT Reads: 5,047
Every day we read jaw-dropping stats on the explosion of data. We allocate significant resources to harness and better understand it. We build businesses around it. But we’ve only just begun. For big payoffs in Big Data, CIOs are turning to cognitive computing. Cognitive computing’s ability to securely extract insights, understand natural language, and get smarter each time it’s used is the next, logical step for Big Data.
May. 25, 2015 08:00 PM EDT Reads: 2,317
The 4th International Internet of @ThingsExpo, co-located with the 17th International Cloud Expo - to be held November 3-5, 2015, at the Santa Clara Convention Center in Santa Clara, CA - announces that its Call for Papers is open. The Internet of Things (IoT) is the biggest idea since the creation of the Worldwide Web more than 20 years ago.
May. 25, 2015 07:00 PM EDT Reads: 2,156
There's no doubt that the Internet of Things is driving the next wave of innovation. Google has spent billions over the past few months vacuuming up companies that specialize in smart appliances and machine learning. Already, Philips light bulbs, Audi automobiles, and Samsung washers and dryers can communicate with and be controlled from mobile devices. To take advantage of the opportunities the Internet of Things brings to your business, you'll want to start preparing now.
May. 25, 2015 07:00 PM EDT Reads: 5,949
With major technology companies and startups seriously embracing IoT strategies, now is the perfect time to attend @ThingsExpo in Silicon Valley. 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 Nov 3-5, 2015, at the Santa Clara Convention Center in Santa Clara, CA, is co-located with 17th Cloud Expo and will feature technical sessions from a rock star conference faculty and the leading industry players in the world. The Internet of Things (IoT) is the most profound change in personal an...
May. 25, 2015 04:00 PM EDT Reads: 3,049
P2P RTC will impact the landscape of communications, shifting from traditional telephony style communications models to OTT (Over-The-Top) cloud assisted & PaaS (Platform as a Service) communication services. The P2P shift will impact many areas of our lives, from mobile communication, human interactive web services, RTC and telephony infrastructure, user federation, security and privacy implications, business costs, and scalability. In his session at @ThingsExpo, Robin Raymond, Chief Architect at Hookflash, will walk through the shifting landscape of traditional telephone and voice services ...
May. 25, 2015 03:00 PM EDT Reads: 4,424
The 17th International Cloud Expo has announced that its Call for Papers is open. 17th International Cloud Expo, to be held November 3-5, 2015, at the Santa Clara Convention Center in Santa Clara, CA, brings together Cloud Computing, APM, APIs, Microservices, Security, Big Data, Internet of Things, DevOps 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 today!
May. 25, 2015 02:00 PM EDT Reads: 4,624
Explosive growth in connected devices. Enormous amounts of data for collection and analysis. Critical use of data for split-second decision making and actionable information. All three are factors in making the Internet of Things a reality. Yet, any one factor would have an IT organization pondering its infrastructure strategy. How should your organization enhance its IT framework to enable an Internet of Things implementation? In his session at Internet of @ThingsExpo, James Kirkland, Chief Architect for the Internet of Things and Intelligent Systems at Red Hat, described how to revolutioniz...
May. 25, 2015 02:00 PM EDT Reads: 5,056
All major researchers estimate there will be tens of billions devices - computers, smartphones, tablets, and sensors - connected to the Internet by 2020. This number will continue to grow at a rapid pace for the next several decades. With major technology companies and startups seriously embracing IoT strategies, now is the perfect time to attend @ThingsExpo, June 9-11, 2015, at the Javits Center in New York City. Learn what is going on, contribute to the discussions, and ensure that your enterprise is as "IoT-Ready" as it can be
May. 25, 2015 01:15 PM EDT Reads: 2,499
The security devil is always in the details of the attack: the ones you've endured, the ones you prepare yourself to fend off, and the ones that, you fear, will catch you completely unaware and defenseless. The Internet of Things (IoT) is nothing if not an endless proliferation of details. It's the vision of a world in which continuous Internet connectivity and addressability is embedded into a growing range of human artifacts, into the natural world, and even into our smartphones, appliances, and physical persons. In the IoT vision, every new "thing" - sensor, actuator, data source, data con...
May. 25, 2015 01:00 PM EDT Reads: 6,490
Container frameworks, such as Docker, provide a variety of benefits, including density of deployment across infrastructure, convenience for application developers to push updates with low operational hand-holding, and a fairly well-defined deployment workflow that can be orchestrated. Container frameworks also enable a DevOps approach to application development by cleanly separating concerns between operations and development teams. But running multi-container, multi-server apps with containers is very hard. You have to learn five new and different technologies and best practices (libswarm, sy...
May. 25, 2015 12:00 PM EDT Reads: 2,332
SYS-CON Events announced today that DragonGlass, an enterprise search platform, will exhibit at SYS-CON's 16th International Cloud Expo®, which will take place on June 9-11, 2015, at the Javits Center in New York City, NY. After eleven years of designing and building custom applications, OpenCrowd has launched DragonGlass, a cloud-based platform that enables the development of search-based applications. These are a new breed of applications that utilize a search index as their backbone for data retrieval. They can easily adapt to new data sets and provide access to both structured and unstruc...
May. 25, 2015 12:00 PM EDT Reads: 2,145
There's Big Data, then there's really Big Data from the Internet of Things. IoT is evolving to include many data possibilities like new types of event, log and network data. The volumes are enormous, generating tens of billions of logs per day, which raise data challenges. Early IoT deployments are relying heavily on both the cloud and managed service providers to navigate these challenges. In her session at Big Data Expo®, Hannah Smalltree, Director at Treasure Data, discussed how IoT, Big Data and deployments are processing massive data volumes from wearables, utilities and other machines...
May. 25, 2015 10:00 AM EDT Reads: 4,359
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 will peel 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 environment, and we must architect and code accordingly. At the very least, you'll have no problem fil...
May. 25, 2015 10:00 AM EDT Reads: 2,113
SYS-CON Events announced today that MetraTech, now part of Ericsson, has been named “Silver Sponsor” of SYS-CON's 16th International Cloud Expo®, which will take place on June 9–11, 2015, at the Javits Center in New York, NY. Ericsson is the driving force behind the Networked Society- a world leader in communications infrastructure, software and services. Some 40% of the world’s mobile traffic runs through networks Ericsson has supplied, serving more than 2.5 billion subscribers.
May. 25, 2015 09:45 AM EDT Reads: 1,805
The worldwide cellular network will be the backbone of the future IoT, and the telecom industry is clamoring to get on board as more than just a data pipe. In his session at @ThingsExpo, Evan McGee, CTO of Ring Plus, Inc., discussed what service operators can offer that would benefit IoT entrepreneurs, inventors, and consumers. Evan McGee is the CTO of RingPlus, a leading innovative U.S. MVNO and wireless enabler. His focus is on combining web technologies with traditional telecom to create a new breed of unified communication that is easily accessible to the general consumer. With over a de...
May. 25, 2015 06:00 AM EDT Reads: 4,850
Disruptive macro trends in technology are impacting and dramatically changing the "art of the possible" relative to supply chain management practices through the innovative use of IoT, cloud, machine learning and Big Data to enable connected ecosystems of engagement. Enterprise informatics can now move beyond point solutions that merely monitor the past and implement integrated enterprise fabrics that enable end-to-end supply chain visibility to improve customer service delivery and optimize supplier management. Learn about enterprise architecture strategies for designing connected systems tha...
May. 25, 2015 05:00 AM EDT Reads: 6,089
Cloud is not a commodity. And no matter what you call it, computing doesn’t come out of the sky. It comes from physical hardware inside brick and mortar facilities connected by hundreds of miles of networking cable. And no two clouds are built the same way. SoftLayer gives you the highest performing cloud infrastructure available. One platform that takes data centers around the world that are full of the widest range of cloud computing options, and then integrates and automates everything. Join SoftLayer on June 9 at 16th Cloud Expo to learn about IBM Cloud's SoftLayer platform, explore se...
May. 25, 2015 04:45 AM EDT Reads: 3,309
SYS-CON Media announced today that 9 out of 10 " most read" DevOps articles are published by @DevOpsSummit Blog. Launched in October 2014, @DevOpsSummit Blog offers top articles, news stories, and blog posts from the world's well-known experts and guarantees better exposure for its authors than any other publication. The widespread success of cloud computing is driving the DevOps revolution in enterprise IT. Now as never before, development teams must communicate and collaborate in a dynamic, 24/7/365 environment. There is no time to wait for long development cycles that produce softw...
May. 25, 2015 04:15 AM EDT Reads: 4,366