Beruflich Dokumente
Kultur Dokumente
Document
Version#
1.00
Approval
Date
10/18/2006
Modified By
T. Healey
This document is permanently stored in the Global Java Community website on knowledgeCentre [12].
Table of Contents
Introduction..................................................................................................................................1
Purpose....................................................................................................................................................................1
Scope.......................................................................................................................................................................2
Architecture Antipatterns.............................................................................................................8
References..................................................................................................................................13
INTRODUCTION
This document outlines a set of architecture mechanisms, approaches, techniques, and guidelines
for building enterprise Java applications as recommend by the AD Global Java Community.
PURPOSE
The primary purpose of this document is to provide guidance for architecture practices used on
-managed software development projects. In this document, architecture refers to high-level
design of an application and the processes used to implement it, typically the responsibility of the
Application Architect and the Project Manager.
SCOPE
The scope of this document includes the following:
1.
Providing guidelines that will aid experienced architects perform their job.
2.
Assisting intermediate level architects and project managers in approaching the set-up
and execution of their projects.
Page 1 of 14
This document is not meant to address all aspects of enterprise software architecture and is no
substitute for skilled and experienced architects. Also, it does not address general project
management best practices, which are covered well by CMMI and PMBOK.
The recommendations are based on collective experience and general industry practice. Many of
the recommendations are not specific to Java.
The reader should note that best practices are always dependent on many environmental
factors, such as:
Finally, this catalog is not intended to be complete. It reflects the best practices and worst
practices (antipatterns) that we tend to see on the majority of projects we work on. The catalog
will need to continually evolve over time as new technologies and practices are encountered.
Page 2 of 14
272473979.doc
3. Prototype: Prototype the architecture, particularly in the early iteration(s) of the project.
Validate application designs, infrastructure, 3rd party tools, performance, system interfaces,
and user interface design early.
4. Experienced Architect: The application architecture should be developed and maintained by
an experienced Java/OO architect/designer, with a singular vision that avoids unnecessary
complexity. Procedural developers (COBOL, C) often make the mistake of creating pseudoOO designs based on functional decomposition techniques. If using GAD QMS OCE work
type, the architect/design team performs the roles of Application Designer, Technical
Leader, Application SME, and Object Designer.
5. Conform to Appropriate Reference Architecture: The application architecture should be
based on a standard JEE reference architecture. Resist the urge to either over- or underarchitect; good architecture is about appropriate balance of forces. Consider the following
references:
6. Bake Best Practices into the Project Plan: Best practices do not happen by accidentthey
must be integrated into the project plan as a joint exercise by the Architect and Project
Manager. For example, there should be a specific task to create the development standards
and establish the development environment. As a part of the plan, best practices must also be
executed and monitored. Regular feedback cycles (usually at the end of each iteration)
should assess how well (or poorly) best practices are being incorporated, and adjustments
made as necessary.
Page 3 of 14
272473979.doc
9. Create E/R Diagrams: Entity/Relationship diagrams should be created showing the structure
of the database and relationship of the tables. Most projects use CA ERwin.
10. Utilize a Service-Oriented Architecture: Utilize a service-oriented architecture (SOA) based
on XML web services for inter- and intra-application interfaces when appropriate. Work out
the services and their interactions early; a team-per-service approach works well to formalize
and build-out the services and their interfaces.
11. Utilize Model-Driven Architecture (MDA) Techniques: Even without a full-blown MDA
tool, large gains in productivity and API documentation completeness can be derived by
using UML and Javadoc to drive code development. Some (many?) teams create
application software specifications in a Microsoft Word-based format, which is extremely
inefficient and error-prone. The project should instead first create designs in UML, then use
the UML tool to create Java class/method stubs. Most IDEs can then generate Javadoc from
the stubs, in which the designer can add details. The IDE can then usually ensure that
everything stays in sync (UMLCodeJavadoc) as the project evolves. If the project
requires the API docs to be in a separate document, there are several tools available to
convert the Javadoc to PDF. Use commonly-available tools (Checkstyle, Eclipse) to verify
that the code base is adequately documented by Javadoc.
12. Automated Code Metrics and Quality Analysis: The project should regularly analyze the
application code to gather metrics and check for compliance to industry and project-specific
coding standards. For example, metrics can identify excessively long methods, methods
without Javadoc, tightly-coupled dependencies, dead code, and other areas for improvement.
The metrics will help gauge how well the other best practices are being followed. The AETapproved tool is Borland Together Architect [9]; however, note that many open source tools
are also excellent: JavaNCSS, JDepend, PMD, FindBugs, QJ-Pro, and Checkstyle.
13. Carefully Manage Data Migration: Data migration from existing sources to new
sources/formats (a.k.a. transition strategies) is a major challenge, and should be treated as
such. Do not underestimate data/hardware migration tasks or leave to junior programmers.
This practice also considers how test data will be created and kept up-to-date.
Page 4 of 14
272473979.doc
Page 5 of 14
272473979.doc
plans, requirements, architecture, design, code, and test cases. However, the team
should ensure peer reviews are effective [13] and not overly bureaucratic.
16.6. Configuration Management Standards (see best practices below)
16.7. Testing Standards (see best practices below)
17. Configuration Management (CM) Best Practices
17.1. CM Tool: Utilize a configuration management tool and associated build scripts (Ant) to
manage the project development. Everything that can be changed, and affect the
behavior of the application, is a candidate for configuration control: source code, data,
database structure, configuration files, test files, etc.). Ensure at least one person on the
team is an expert in using the CM tool to manage labels, branches, and builds. The
developers should also be familiar with source control features in their IDE to compare
code, rollback, merge, etc. Further guidance on Borland StarTeam, the EDSrecommended CM tool for Java, is available on the AET website [14].
17.2. Automated Builds: The project should utilize an automated environment to build the
application and manage dependencies. Consider using de facto standard tools such as
Ant, Maven, and CruiseControl. A huge advantage of automating the build process is
that many of the other best practices (Automate Unit Testing (18.1), Code Metrics (12),
etc.) can be automated by attaching them to the build process.
17.3. Continuous Integration: Code under development should be integrated and built at
regular intervals (preference towards nightly builds) in order to catch problems early.
This practice is particularly important with distributed teams, where merge problems
can arise if code is checked-out for long periods of time or code is being developed in a
tag team type of approach (i.e., follow the sun). Continuous Integration is most
effective when combined with Automated Builds (17.2), Automated Unit Testing (18.1),
and Automated Code Metrics and Quality Analysis (12). Keep an eye on the
forthcoming Gauntlet tool from Borland.
17.4. Build Management: The project should develop a holistic view of the build process,
encompassing everything from source management and compilation all the way
through to release to the customer. If the development team is distributed, ensure
adequate documentation, communication, and controls are in-place to manage the entire
lifecycle (develop, integrate, test, deploy). Ensure all developers are aware of and
trained in the lifecycle processes that have been established for the project.
18. Testing Best Practices
18.1. Automated Unit Testing: Unit tests should be created using JUnit or TestNG. Strive for
at least 75% code coverage (which can be measured with Optimizeit or jcoverage
tools). If a strong unit test suite is not already in place, consider using commerciallyavailable tools to assist developing an initial set. A wealth of usage guidance is
available for JUnit, including the RCF [15] training materials.
Page 6 of 14
272473979.doc
18.2. Reusable Test Plans: Integration and functional tests should be created with reusability
in mind. There should be a common library and index of test plans for the application.
If possible, automate tests using Mercury WinRunner, HttpUnit, Fit, Canoo Webtest or
similar tool.
18.3. Automated Regression Testing: Existing test scripts should be executed before each
release to ensure existing functionality continues to work as expected.
18.4. Performance Testing: Conduct performance/load testing and profiling at regular
intervals, using tools like Borland Optimizeit [14] and JMeter.
18.5. Model Office Test Environment: A test environment that mirrors the production
environment as closely as possible (hardware, middleware, etc.) should be established
and used to perform a variety of tests (particularly performance tests) prior to
production deployment.
18.6. Test-Driven Development: Test-driven development (TDD), in which automated
(JUnit) tests are written simultaneously with the low-level design and coding tasks, is
now widely considered a best practice [23]. It tends to yield simpler, cleaner designs
that have fewer bugs while simultaneously creating Automated Unit Tests (18.1) along
the way.
19. Object-friendly Database Design: The persistency approach, database and object models
should be designed concurrently, by specialists familiar with JEE implementation. The Java
architect and data architect must agree on the overall design and persistency approach,
especially regarding usage of tools such as TopLink, Hibernate, or iBATIS.
20. Manage Defects: As defects are uncovered in the project, they should be tracked in a
database such as StarTeam, ClearQuest, Bugzilla, or Aldea. Ideally, the defect management
tool should be integrated with the CM tool (if not, utilize a numbering scheme that can track
how/when defects are corrected). Defect tracking allows the project management team and
client gauge when a project is ready to release, as well as identify problems with the
development process.
Page 7 of 14
272473979.doc
Xalan, Struts, Spring, Hibernate, and Log4j. For further details on the advantages and
disadvantages of many of these technologies, refer to the RCF Model Implementation Guide
[16].
23. Optimize the Server(s): Especially in greenfield deployments, the application and database
server(s) must be tuned for optimum performance and reliability. This usually requires
vendor-specific knowledge (e.g., BEA WebLogic vs. JBoss). Consider bringing in a vendorcertified consultant for a week or two.
24. Plan Deployment Early: Implementation plans, deployment scripts, support guides, etc.
should be created early in the project, and continually updated and reviewed. Such an
approach helps to ensure that compatibility, support, security, and a host of other potential
issues are identified and addressed by the architecture. There are a variety of resources
(checklists, etc.) available on this topic.
25. Production Support Handbook: Every application should have some type of guidebook to
assist support personnel with both common and abnormal support situations. Such a
handbook is also useful for new developers, because it should describe the runtime
characteristics of the application, such as: system environment, hardware/middleware,
application schedules, configuration files, locations of databases, contacts, etc. Shells and
completeness criteria can be found in the BPR [20].
ARCHITECTURE ANTIPATTERNS
The following bad practices should be avoidedif already present, consider institutionalizing
one or more of the indicated best practice(s). When available, we have referenced the origin of
the antipattern name; if not given, the name was invented by the authors.
Architecture Antipattern / smell
Page 8 of 14
272473979.doc
Big Ball of Mud [18]: Due to a variety of forces over time, the
application design has eroded to the point that it is difficult to
analyze and maintain. This is the application version of the
giant hairball. It shows signs of other antipatterns such as
spaghetti code and cut-and-paste programming.
Consider
InternationalizationI18N
Requirements (15)
Page 9 of 14
272473979.doc
Fox in the Hen House: Changes are put into production that
are not adequately documented and/or tested. This often
results in defects and maintenance problems over the long
term. It is closely related to the Lack of Development
Processes antipattern (oftentimes, documented engineering
standards and processes exist, but they are not enforced, which
is equally problematic). [19]
Prototype (3)
Bake Best Practices Into the
Project Plan (6)
Configuration Management
Best Practices (17.x)
Manage Defects (20)
Plan Deployment Early (24)
Page 10 of 14
272473979.doc
Prototype (3)
Identify Non-functional
Requirements (14)
Performance Testing (18.4)
Utilize Clustering (21)
Server Optimization (23)
Plan Deployment Early (24)
Utilize a Service-Oriented
Architecture (10)
Page 11 of 14
272473979.doc
Conform to Standard
Architecture Patterns (5)
Utilize Standards-Based ReUsable Components (22)
Page 12 of 14
272473979.doc
REFERENCES
We are indebted to a variety of
document.
1.
Larman, Craig. Agile & Iterative Development: A Managers Guide. Addison-Wesley, 2004.
2.
3.
A3 Architecture: http://infocentre.eds.com/who/work/a3/index.html
4.
5.
6.
7.
8.
9.
Page 13 of 14
272473979.doc
Page 14 of 14
272473979.doc