Product Details
Patterns of Enterprise Application Architecture

Patterns of Enterprise Application Architecture
By Martin Fowler

List Price: $69.99
Price: $41.65 & eligible for FREE Super Saver Shipping on orders over $25. Details

Availability: Usually ships in 24 hours
Ships from and sold by Amazon.com

61 new or used available from $29.99

Average customer review:

Product Description

Noted software engineering expert, Martin Fowler, turns his attention to enterprise application development. He helps professionals understand the complex--yet critical--aspects of architecture. Enables the reader to make proper choices when faced with a difficult design decision.


Product Details

  • Amazon Sales Rank: #16749 in Books
  • Published on: 2002-11-15
  • Original language: English
  • Number of items: 1
  • Binding: Hardcover
  • 560 pages

Editorial Reviews

From the Back Cover

The practice of enterprise application development has benefited from the emergence of many new enabling technologies. Multi-tiered object-oriented platforms, such as Java and .NET, have become commonplace. These new tools and technologies are capable of building powerful applications, but they are not easily implemented. Common failures in enterprise applications often occur because their developers do not understand the architectural lessons that experienced object developers have learned.

Patterns of Enterprise Application Architecture is written in direct response to the stiff challenges that face enterprise application developers. The author, noted object-oriented designer Martin Fowler, noticed that despite changes in technology--from Smalltalk to CORBA to Java to .NET--the same basic design ideas can be adapted and applied to solve common problems. With the help of an expert group of contributors, Martin distills over forty recurring solutions into patterns. The result is an indispensable handbook of solutions that are applicable to any enterprise application platform.

This book is actually two books in one. The first section is a short tutorial on developing enterprise applications, which you can read from start to finish to understand the scope of the book's lessons. The next section, the bulk of the book, is a detailed reference to the patterns themselves. Each pattern provides usage and implementation information, as well as detailed code examples in Java or C#. The entire book is also richly illustrated with UML diagrams to further explain the concepts.

Armed with this book, you will have the knowledge necessary to make important architectural decisions about building an enterprise application and the proven patterns for use when building them.

The topics covered include:

  • Dividing an enterprise application into layers
  • The major approaches to organizing business logic
  • An in-depth treatment of mapping between objects and relational databases
  • Using Model-View-Controller to organize a Web presentation
  • Handling concurrency for data that spans multiple transactions
  • Designing distributed object interfaces


  • 0321127420B10152002

    About the Author

    Martin Fowler is an independent consultant who has applied objects to pressing business problems for more than a decade. He has consulted on systems in fields such as health care, financial trading, and corporate finance. His clients include Chrysler, Citibank, UK National Health Service, Andersen Consulting, and Netscape Communications. In addition, Fowler is a regular speaker on objects, the Unified Modeling Language, and patterns.

    0321127420AB07242003

    Excerpt. © Reprinted by permission. All rights reserved.

    In the spring of 1999 I flew to Chicago to consult on a project being done by ThoughtWorks, a small but rapidly growing application development company. The project was one of those ambitious enterprise application projects: a back-end leasing system. Essentially it deals with everything that happens to a lease after you've signed on the dotted line: sending out bills, handling someone upgrading one of the assets on the lease, chasing people who don't pay their bills on time, and figuring out what happens when someone returns the assets early. That doesn't sound too bad until you realize that leasing agreements are infinitely varied and horrendously complicated. The business "logic" rarely fits any logical pattern, because, after all, it's written by business people to capture business, where odd small variations can make all the difference in winning a deal. Each of those little victories adds yet more complexity to the system.

    That's the kind of thing that gets me excited: how to take all that complexity and come up with a system of objects that can make the problem more tractable. Indeed, I believe that the primary benefit of objects is in making complex logic tractable. Developing a good Domain Model (116) for a complex business problem is difficult but wonderfully satisfying.

    Yet that's not the end of the problem. Our domain model had to be persisted to a database, and, like many projects, we were using a relational database. We also had to connect this model to a user interface, provide support to allow remote applications to use our software, and integrate our software with third-party packages. All of this on a new technology called J2EE, which nobody in the world had any real experience in using.

    Even though this technology was new, we did have the benefit of experience. I'd been doing this kind of thing for ages with C++, Smalltalk, and CORBA. Many of the ThoughtWorkers had a lot of experience with Forte. We already had the key architectural ideas in our heads, and we just had to figure out how to apply them to J2EE. Looking back on it three years later, the design is not perfect but it has stood the test of time pretty damn well.

    That's the kind of situation this book was written for. Over the years I've seen many enterprise application projects. These projects often contain similar design ideas that have proven effective in dealing with the inevitable complexity that enterprise applications possess. This book is a starting point to capture these design ideas as patterns.

    The book is organized in two parts, with the first part a set of narrative chapters on a number of important topics in the design of enterprise applications. These chapters introduce various problems in the architecture of enterprise applications and their solutions. However, they don't go into much detail on these solutions. The details of the solutions are in the second part, organized as patterns. These patterns are a reference, and I don't expect you to read them cover to cover. My intention is that you read the narrative chapters in Part 1 from start to finish to get a broad picture of what the book covers; then you dip into the patterns chapters of Part 2 as your interest and needs drive you. Thus, the book is a short narrative book and a longer reference book combined into one.

    This is a book on enterprise application design. Enterprise applications are about the display, manipulation, and storage of large amounts of often complex data and the support or automation of business processes with that data. Examples include reservation systems, financial systems, supply chain systems, and many others that run modern business. Enterprise applications have their own particular challenges and solutions, and they are different from embedded systems, control systems, telecoms, or desktop productivity software. Thus, if you work in these other fields, there's nothing really in this book for you (unless you want to get a feel for what enterprise applications are like.)

    There are many architectural issues in building enterprise applications. I'm afraid this book can't be a comprehensive guide to them. In building software I'm a great believer in iterative development. At the heart of iterative development is the notion that you should deliver software as soon as you have something useful to the user, even if it's not complete. Although there are many differences between writing a book and writing software, this notion is one that I think the two share. That said, this book is an incomplete but (I trust) useful compendium of advice on enterprise application architecture. The primary topics I talk about are

  • Layering of enterprise applications
  • Structuring domain (business) logic
  • Structuring a Web user interface
  • Linking in-memory modules (particularly objects) to a relational database
  • Handling session state in stateless environments
  • Principles of distribution
  • The list of things I don't talk about is rather longer. I really fancied writing about organizing validation, incorporating messaging and asynchronous communication, security, error handling, clustering, application integration, architectural refactoring, structuring rich-client user interfaces, among other topics. However, because of space and time constraints and lack of cogitation, you won't find them in this book. I can only hope to see some patterns for this work in the near future. Perhaps I'll do a second volume someday and get into these topics, or maybe someone else will fill these and other gaps.

    Of these, message-based communication is a particularly big issue. People who are integrating multiple applications are increasingly making use of asynchronous message-based communication approaches. There's much to be said for using them within an application as well. This book is not intended to be specific for any particular software platform. I first came across these patterns while working with Smalltalk, C++, and CORBA in the late '80s and early '90s. In the late '90s I started to do extensive work in Java and found that these patterns applied well to both early Java/CORBA systems and later J2EE-based work. More recently I've been doing some initial work with Microsoft's .NET platform and find the patterns apply again. My ThoughtWorks colleagues have also introduced their experiences, particularly with Forte. I can't claim generality across all platforms that have ever been or will be used for enterprise applications, but so far these patterns have shown enough recurrence to be useful.

    I have provided code examples for most of the patterns. My choice of language for them is based on what I think most readers are likely to be able to read and understand. Java is a good choice here. Anyone who can read C or C++ can read Java, yet Java is much less complex than C++. Essentially most C++ programmers can read Java but not vice versa. I'm an object bigot, so I inevitably lean to an OO language. As a result, most of the code examples are in Java. As I was working on the book, Microsoft started stabilizing its .NET environment, and its C# language has most of the same properties as Java for an author. So I did some of the code examples in C# as well, although that introduced some risk since developers don't have much experience with .NET and so the idioms for using it well are less mature. Both are C-based languages, so if you can read one you should be able to read both, even if you aren't deeply into that language or platform. My aim was to use a language that the largest amount of software developers can read, even if it's not their primary or preferred language. (My apologies to those who like Smalltalk, Delphi, Visual Basic, Perl, Python, Ruby, COBOL, or any other language. I know you think you know a better language than Java or C#. All I can say is I do, too!)

    The examples are there for inspiration and explanation of the ideas in the patterns. They aren't canned solutions; in all cases you'll need to do a fair bit of work to fit them into your application. Patterns are useful starting points, but they are not destinations.

    Who This Book Is For

    I've written this book for programmers, designers, and architects who are building enterprise applications and who want to improve either their understanding of architectural issues or their communication about them.

    I'm assuming that most of my readers will fall into two groups: those with modest needs who are looking to build their own software and readers with more demanding needs who will be using a tool. For those of modest needs, my intention is that these patterns should get you started. In many areas you'll need more than the patterns will give you, but I'll provide you more of a headstart in this field than I got. For tool users I hope this book will give you some idea of what's happening under the hood and also help you choose which of the tool-supported patterns to use. Using, say, an object-relational mapping tool still means that you have to make decisions about how to map certain situations. Reading the patterns should give you some guidance in making the choices.

    There is a third category; those with demanding needs who want to build their own software. The first thing I'd say here is to look carefully at using tools. I've seen more than one project get sucked into a long exercise at building frameworks, which wasn't what the project was really about. If you're still convinced, go ahead. Remember in this case that many of the code examples in this book are deliberately simplified to help understanding, and you'll find you'll need to do a lot tweaking to handle the greater demands you face.

    Since patterns are common solutions to recurring problems, there's a good chance that you have already come across some of them. If you've been working in enterprise applications for a while, you may well know most of them. I'm not claiming to present anything new in this book. Indeed, I claim the opposite--this is a book of (for our industry) old ideas. If you're new to this field, I hope the book wi...


    Customer Reviews

    Great book, but nothing particularly new4
    I agree wholeheartedly with an above post which pointed out that the subject material is mostly known to the average enterprise developer. I am at best an average developer and found I'd already thought of much of this stuff myself.

    One thing I would like to add is that this book was still excellent reading and skimming through the patterns sparked my creative energies. I find that when I read through it, even if I 'know' the patterns already, it helps me explore their organization and consequences.

    I was disappointed that I wasn't blown away with helpful new concepts, but quite happy with my purchase all the same. Buy this if you want a thorough guide to EAA and maybe some enjoyable afternoon reading.

    (The following was added about 2 months after the original review) After owning this book for awhile, I've found it more and more indispensible. My original review, above, mentions that few of the concepts seem new, however, now that I've read it more thoroughly and applied some of the concepts, I don't think that 'mind-blowing originality' is what I should have been looking for.

    Fowler's 'Refactoring' is another example of a great book without any stunningly original concepts. Like Refactoring, PEAA can serve as a great guide to page through when you're stuck on a project and need to review your options.

    The right path to creating enterprise applications.5
    Fowler avoids giving a precise definition of an enterprise application, preferring to list a set of characteristics that most share. In general, they are very large systems, with many user interface screens used to concurrently access and update an enormous amount of data. In nearly all cases, the data must be persistent, in fact it most often is very persistent, meaning that it has to live through iterations of the software, alterations of the operating system, changes in the hardware, and staff and programmer turnover.
    Furthermore, enterprise applications usually must communicate with other applications, which are often just as large and complex. Examples include payroll and patient records, credit card processing, insurance claim processing, banking, and foreign exchange trading. In short, most of the programs that run the modern global economy, which are many of the most complex software projects currently in use. Finally, the programs must be constructed so that they can be "easily and quickly" changed by people who did not create them to adapt to conditions that can change very quickly and often without any input from the programmer. With so much at stake, there must be a set of best practices, which is what is captured in this book.
    The patterns of software construction explained by Fowler are generally in the small, in the sense that they describe specific operations rather than demonstrate a large architectural form. Each of the specific patterns is presented by first listing a one-sentence description of the purpose of the pattern and a UML diagram illustrating the structure. This is followed by sections describing how the pattern works, when to use it and one or more examples demonstrating specific implementations of the pattern using source code skeletons. Both C# and Java are used in the demonstrations, which does not create an understandability problem. The languages and contexts are so similar that anyone who can understand either one will have no problem reading and understanding the code.
    Some examples of the fifty one patterns listed on the inside front cover are:

    Lazy load - where an object will load only the data currently needed, but does maintain links to all other data that may be needed.

    Front controller - a single handler object that consolidates all requests made for a web site. It can then send requests to the specific objects for services such as security, internationalization issues and specific displays targeted for particular users and locations.

    Optimistic offline lock - used to prevent conflicts when concurrent business transactions are executing. The solution is to roll back the transaction when a conflict is detected.

    Server session state - keeps the data for the session stored on a server in a serialized form.

    While the examples are often of necessity extremely simple, they do illustrate some of the most effective and tested solutions to common software development problems. Therefore, this is a book that no builder of software that can be considered an enterprise application should be without. It is hard to believe that there is an enterprise application being constructed anywhere that does not involve the solving of many of the problems listed in this book.
    My only complaint is the occasional bad English that appears. For example, on page 100 there is the phrase, "The only reason I've concentrating on Java . . . " and on page 119 the phrase "One factor that comes into this is comfortable used the development team is . . . " appears. While no book is error free, this type of error is frequent enough to make one wonder about the quality of the final editing.
    There is nothing harder than making effective and efficient software that will run the IT equivalent of forever. That is what enterprise applications are supposed to do and if you are one of the minions tasked with doing your part to build one, then put yourself on the right path and read this book. You and everyone else who interacts with the software will be rewarded with a better experience.

    Published in the online "Journal of Object Technology", reprinted with permission.

    Would have been a great book 2-3 years ago3
    First, I'd like to say that I think Marin Fowler is awesome. I've been a long time fan of his and I really enjoy his talks and his books. So when you read this review, you can tell that it pains me to write what I have to say. I don't want to rip apart his book so that he potentially sells fewer copies - that's not my intention at all. By writing 3 books myself, I appreciate that authors don't make a lot of money for developing the book itself. Usually people like Martin write books for the experience and to generally help people.

    That being said, many developers will unfortunately not find this book very useful. Many of the patterns Martin shows us have a lot of dependency on the platform you are using to implement the application. For instance, if you use Microsoft's .NET platform, you are going to be leaning towards a Table Module instead of a Domain Model. If you do not use a Table Module, you will not be able to take advantage of a considerable amount of functionality that is provided for you within the .NET platform. In Java, the same is true; the Table Module doesn't look as appealing if you are using EJBs, JDO or even Hibernate - you won't ever consider it.

    Many of the patterns in the book have this characteristic described above, so architects won't actually learn anything from them. In other words, architects will not be able to take advantage of these alternate design patterns without some initial headaches that are often not worth it because the platform they use restricts and penalizes their usage.

    Another complaint about the book is that many of the patterns are already available as frameworks. For instance, many of the presentation patterns are handled by frameworks like Struts or Webwork. In these cases, learning about the patterns that are associated with these frameworks will provide little value. These patterns have already been discussed many times before in other books like "Advanced Java Server Pages" for example.

    The same could also be said for persistence frameworks of O/R mapping tools. There is literally over a 100 pages (in a 500 page book) that talk about lazy loads, unit of work, locking strategies, metadata patterns and inheritance mappings. Although sometimes they are useful, in most situations the developers would be abstracted away from all these underlying mechanics using a good persistence framework or O/R mapping tool. I realize not all that the this is true, but implementing Martin's suggestions would take a month or two alone if you didn't buy anything off the shelf - that's too much time to waste. Martin should have talked more about these tools and the patterns they currently implemented instead as this is a more pragmatic approach.

    Martin also doesn't talk about the load-on-startup servlet that can be used to store application-scoped values in the ServletContext (for J2EE systems) in his Registry pattern. This was unfortunate because many non-ejb systems use this approach. Considering the book advocates using POJOs, JDO or JDBC instead of EJBs (which is sound advice in practice for most systems), they didn't cover the registry alternates for this approach. Many of us use containers like Resin because they are extremely fast and have no need for EJB development.

    Coming from three different environments myself (PHP, .NET and J2EE), I was disappointed that I didn't learn anything from this book. I had, in fact, learned about many of these patterns on my own, but didn't exactly know what they were called. This left me disappointed, but it's not Martin's fault. I don't mean to build me up that I know everything, but I think I've reached a plateau when it comes to designing and architecting systems - I'm good at it. If you happen to be a good designer too and you think you might want to broaden your knowledge, then this book won't help in those areas. If this book doesn't, I don't think you'll find another book that will either. So again, this isn't Martin's fault.

    Now before you say something, Martin explicitly states in his book that many experienced designers *will not* learn much. He mentions more than a few times that this book is meant to enhance the communication between architects and designers more than anything and that it is meant to be a documented repository of patterns that we know as an industry and use over and over. I completely agree with these statements. Thus, the book has value in these regards and it will definitely help the industry evolve and mature.

    I know I've said some negative things about the book, but let's face it - this is Martin Fowler! The quality and style of the writing is top notch and the organization of the information couldn't have been better. The explanations and examples are very clear and this book is what it claims to be. In this respect, the book should be regarded as the best in its market.

    I would advocate purchasing this book in combination with "EJB Design Patterns" and "Expert One-On-One: J2EE Design and Development" for the J2EE developer. As for you .NET folks, I have no idea. From experience, I suspect that .NET developers will have even less use for this book since Microsoft has limited your choices about design in favour of simplifying the platform. That's one of the major differences between J2EE and .NET, and Martin can't control that either.

    Overall, this is a good book. I give it only 3 stars, however, because of the initial problems described above.