|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.
What a difference a year makes. Organizations aren’t just talking about IoT possibilities, it is now baked into their core business strategy. With IoT, billions of devices generating data from different companies on different networks around the globe need to interact. From efficiency to better customer insights to completely new business models, IoT will turn traditional business models upside down. In the new customer-centric age, the key to success is delivering critical services and apps wit...
May. 24, 2016 11:45 PM EDT Reads: 754
The essence of data analysis involves setting up data pipelines that consist of several operations that are chained together – starting from data collection, data quality checks, data integration, data analysis and data visualization (including the setting up of interaction paths in that visualization). In our opinion, the challenges stem from the technology diversity at each stage of the data pipeline as well as the lack of process around the analysis.
May. 24, 2016 11:30 PM EDT Reads: 1,035
As cloud and storage projections continue to rise, the number of organizations moving to the cloud is escalating and it is clear cloud storage is here to stay. However, is it secure? Data is the lifeblood for government entities, countries, cloud service providers and enterprises alike and losing or exposing that data can have disastrous results. There are new concepts for data storage on the horizon that will deliver secure solutions for storing and moving sensitive data around the world. ...
May. 24, 2016 11:15 PM EDT Reads: 987
In his session at 18th Cloud Expo, Bruce Swann, Senior Product Marketing Manager at Adobe, will discuss how the Adobe Marketing Cloud can help marketers embrace opportunities for personalized, relevant and real-time customer engagement across offline (direct mail, point of sale, call center) and digital (email, website, SMS, mobile apps, social networks, connected objects). Bruce Swann has more than 15 years of experience working with digital marketing disciplines like web analytics, social med...
May. 24, 2016 10:45 PM EDT Reads: 1,072
Designing IoT applications is complex, but deploying them in a scalable fashion is even more complex. A scalable, API first IaaS cloud is a good start, but in order to understand the various components specific to deploying IoT applications, one needs to understand the architecture of these applications and figure out how to scale these components independently. In his session at @ThingsExpo, Nara Rajagopalan is CEO of Accelerite, will discuss the fundamental architecture of IoT applications, ...
May. 24, 2016 10:45 PM EDT Reads: 717
With major technology companies and startups seriously embracing IoT strategies, now is the perfect time to attend @ThingsExpo 2016 in New York and 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 ...
May. 24, 2016 06:00 PM EDT Reads: 4,649
The 19th International Cloud Expo has announced that its Call for Papers is open. Cloud Expo, to be held November 1-3, 2016, at the Santa Clara Convention Center in Santa Clara, CA, 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 y...
May. 24, 2016 05:00 PM EDT Reads: 1,842
There are several IoTs: the Industrial Internet, Consumer Wearables, Wearables and Healthcare, Supply Chains, and the movement toward Smart Grids, Cities, Regions, and Nations. There are competing communications standards every step of the way, a bewildering array of sensors and devices, and an entire world of competing data analytics platforms. To some this appears to be chaos. In this power panel at @ThingsExpo, moderated by Conference Chair Roger Strukhoff, panelists will discuss the vast to...
May. 24, 2016 04:00 PM EDT Reads: 2,355
Internet of @ThingsExpo, taking place November 1-3, 2016, at the Santa Clara Convention Center in Santa Clara, CA, is co-located with the 19th International Cloud Expo and will feature technical sessions from a rock star conference faculty and the leading industry players in the world and ThingsExpo New York Call for Papers is now open.
May. 24, 2016 04:00 PM EDT Reads: 1,681
SYS-CON Events announced today that Enzu, a leading provider of cloud hosting solutions, will exhibit at SYS-CON's 18th International Cloud Expo®, which will take place on June 7-9, 2016, at the Javits Center in New York City, NY. Enzu’s mission is to be the leading provider of enterprise cloud solutions worldwide. Enzu enables online businesses to use its IT infrastructure to their competitive advantage. By offering a suite of proven hosting and management services, Enzu wants companies to foc...
May. 24, 2016 02:15 PM EDT Reads: 2,080
SYS-CON Events announced today the How to Create Angular 2 Clients for the Cloud Workshop, being held June 7, 2016, in conjunction with 18th Cloud Expo | @ThingsExpo, at the Javits Center in New York, NY. Angular 2 is a complete re-write of the popular framework AngularJS. Programming in Angular 2 is greatly simplified. Now it’s a component-based well-performing framework. The immersive one-day workshop led by Yakov Fain, a Java Champion and a co-founder of the IT consultancy Farata Systems and...
May. 24, 2016 02:00 PM EDT Reads: 3,849
IoT generates lots of temporal data. But how do you unlock its value? How do you coordinate the diverse moving parts that must come together when developing your IoT product? What are the key challenges addressed by Data as a Service? How does cloud computing underlie and connect the notions of Digital and DevOps What is the impact of the API economy? What is the business imperative for Cognitive Computing? Get all these questions and hundreds more like them answered at the 18th Cloud Expo...
May. 24, 2016 01:45 PM EDT Reads: 2,058
Customer experience has become a competitive differentiator for companies, and it’s imperative that brands seamlessly connect the customer journey across all platforms. With the continued explosion of IoT, join us for a look at how to build a winning digital foundation in the connected era – today and in the future. In his session at @ThingsExpo, Chris Nguyen, Group Product Marketing Manager at Adobe, will discuss how to successfully leverage mobile, rapidly deploy content, capture real-time d...
May. 24, 2016 01:45 PM EDT Reads: 1,370
In his keynote at 18th Cloud Expo, Andrew Keys, Co-Founder of ConsenSys Enterprise, will provide an overview of the evolution of the Internet and the Database and the future of their combination – the Blockchain. Andrew Keys is Co-Founder of ConsenSys Enterprise. He comes to ConsenSys Enterprise with capital markets, technology and entrepreneurial experience. Previously, he worked for UBS investment bank in equities analysis. Later, he was responsible for the creation and distribution of life ...
May. 24, 2016 01:30 PM EDT Reads: 1,758
SYS-CON Events announced today that ContentMX, the marketing technology and services company with a singular mission to increase engagement and drive more conversations for enterprise, channel and SMB technology marketers, has been named “Sponsor & Exhibitor Lounge Sponsor” of SYS-CON's 18th Cloud Expo, which will take place on June 7-9, 2016, at the Javits Center in New York City, New York. “CloudExpo is a great opportunity to start a conversation with new prospects, but what happens after the...
May. 24, 2016 10:30 AM EDT Reads: 743
SYS-CON Events announced today that 24Notion has been named “Bronze Sponsor” of SYS-CON's 18th Cloud Expo, which will take place on June 7-9, 2016, at the Javits Center in New York, New York. 24Notion is full-service global creative digital marketing, technology and lifestyle agency that combines strategic ideas with customized tactical execution. With a broad understand of the art of traditional marketing, new media, communications and social influence, 24Notion uniquely understands how to con...
May. 24, 2016 09:30 AM EDT Reads: 1,685
The demand for organizations to expand their infrastructure to multiple IT environments like the cloud, on-premise, mobile, bring your own device (BYOD) and the Internet of Things (IoT) continues to grow. As this hybrid infrastructure increases, the challenge to monitor the security of these systems increases in volume and complexity. In his session at 18th Cloud Expo, Stephen Coty, Chief Security Evangelist at Alert Logic, will show how properly configured and managed security architecture can...
May. 24, 2016 09:00 AM EDT Reads: 1,964
When it comes to IoT in the enterprise, namely the commercial building and hospitality markets, a benefit not getting the attention it deserves is energy efficiency, and IoT's direct impact on a cleaner, greener environment when installed in smart buildings. Until now clean technology was offered piecemeal and led with point solutions that require significant systems integration to orchestrate and deploy. There didn't exist a 'top down' approach that can manage and monitor the way a Smart Buildi...
May. 24, 2016 08:30 AM EDT Reads: 2,055
SYS-CON Events announced today BZ Media LLC has been named “Media Sponsor” of SYS-CON's 19th International Cloud Expo, which will take place on November 1–3, 2016, at the Santa Clara Convention Center in Santa Clara, CA. BZ Media LLC is a high-tech media company that produces technical conferences and expositions, and publishes a magazine, newsletters and websites in the software development, SharePoint, mobile development and Commercial Drone markets.
May. 24, 2016 06:00 AM EDT Reads: 3,390
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, will discuss the importance of WebRTC and how it enables companies to fo...
May. 24, 2016 04:30 AM EDT Reads: 2,409