Home - Pencil Project. Domain-driven design with Java EE 6. For Java EE applications based on type-dependent algorithms, a domain-driven design that leverages object-orientation is better than a procedurally implemented service-oriented architecture.
Adam Bien explains how and why object-oriented persistence makes your domain-driven application's code more efficient, maintainable, and testable. Level: Advanced In "Lean service architectures with Java EE 6," I discussed how to implement a maintainable service-oriented architecture (SOA) that is based on anemic persistent objects and transient, stateless services. In this follow-up article, you'll learn about an architectural approach that is the exact opposite of that. What ties together the two architectures is that both can be implemented with Java EE 6 and, in particular, Enterprise JavaBeans (EJB). As I'll explain in this article, you can build domain-driven applications with "real" objects -- objects that comprise encapsulated state and well-defined behavior. Listing 1. Listing 2. Listing 3. Lean service architectures with Java EE 6.
Although Java EE 6 is far less complex than previous platform versions, it can still be misused to create exaggerated and bloated architectures. In this article, Adam Bien delineates the essential ingredients of a lean service-oriented architecture (SOA), then explains how to implement it without sacrificing maintainability. Level: Intermediate The complexity and bloat often associated with Java EE are largely due to the inherent complexity of distributed computing; otherwise, the platform is surprisingly simple. As I discussed in my last article for JavaWorld, Enterprise JavaBeans (EJB) 3.1 actually consists of annotated classes and interfaces that are even leaner than classic POJOs; it would be hard to find anything more to simplify. Nonetheless, (mis)use of Java EE can lead to bloated and overstated architectures.
SOA: The essential ingredients The crucial artifact in any SOA is an exposed service. Scalable System Design Patterns. Looking back after 2.5 years since my previous post on scalable system design techniques, I've observed an emergence of a set of commonly used design patterns.
Here is my attempt to capture and share them. Load Balancer In this model, there is a dispatcher that determines which worker instance will handle the request based on different policies. The application should best be "stateless" so any worker instance can handle the request. This pattern is deployed in almost every medium to large web site setup. Scatter and Gather In this model, the dispatcher multicast the request to all workers of the pool. This pattern is used in Search engines like Yahoo, Google to handle user's keyword search request ... etc.
Result Cache In this model, the dispatcher will first lookup if the request has been made before and try to find the previous result to return, in order to save the actual execution. This pattern is commonly used in large enterprise application. Shared Space Pipe and Filter Map Reduce. A Note on the Thread (Un)safety of Format Classes. I recently got a note on another blog post asking this question: I have a general question on the thread safety and this is not directly related with your blog.
I would appreciate if you could post it on your blog. I have a class that has only one static method that accepts two string parameters and does some operation locally (as shown below). Antonio Goncalves' Weblog. Friday September 07, 2007 Let‘s face it. Exceptions in Java have always been a nightmare because we‘ve never known how to handle them properly. Hundreads of articles and thousands of blogs have tried to help us on “how to use exceptions in Java“. We went from “all exception should be checked“ to “all shoud be unchecked“ and then to “business exception should be checked and technical exceptions unchecked“, “each layer should wrap the parent exception“, “just throw it to the client”... hummm… I‘m not even sure if I agree with all that.
On top of all that, Java EE 5 has arrived with a new annotation that can confuse even more the way exceptions should be handled. In terms of transactions, how does it work? On the BBean.createsB() method you can throw different kind of exceptions (1).