(by Ted Neward, Addison-Wesley)
Prefer components as the key element of development, deployment, and reuse
Prefer loose coupling across component boundaries
Differentiate layers from tiers
Keep data and processors close together
Remember that identity breeds contention
Use hook points to inject optimizations, customizations, or new functionality
Be robust in the face of failure
Define your performance and scalability goals
Restrict EJB to transactional processing
Never optimize without profiling first
Recognize the cost of vendor neutrality
Build in monitoring support
Build in administration support
Make deployment as simple as possible
Understand all your communications options
Consider your lookup carefully
Recognize the cost of network access
Prefer context-complete communication styles
Prefer data-driven communication over behavior-driven communication
Avoid waiting for remote service requests to respond
Consider partitioning components to avoid excessive load on any one machine
Consider using Web Services for open integration
Pass data in bulk
Consider rolling your own communication proxies
Keep it simple
Prefer rules engines for complex state evaluation and execution
Prefer transactional processing for implicitly nonatomic failure scenarios
Differentiate user transactions from system transactions
Minimize lock windows
Never cede control outside your component while holding locks
Understand EJB transactional affinity
Prefer local transactions to distributed ones
Consider using optimistic concurrency for better scalability
Consider using pessimistic concurrency for explicit concurrency control
Consider lower isolation levels for better transactional throughput
Use savepoints to keep partial work in the face of rollback
Replicate resources when possible to avoid lock regions
Favor the immutable, for it needs no locks
Use HttpSession sparingly
Use objects-first persistence to preserve your domain model
Use relational-first persistence to expose the power of the relational model
Use procedural-first persistence to create an encapsulation layer
Recognize the object-hierarchical impedance mismatch
Use in-process or local storage to avoid the network
Never assume you own the data or the database
Lazy-load infrequently used data
Eager-load frequently used data
Batch SQL work to avoid round-trips
Know your JDBC provider
Tune your SQL
Consider rich-client UI technologies
Keep HTML minimal
Separate presentation from processing
Keep style separate from content
Pregenerate content to minimize processing
Validate early, validate everything
Security is a process, not a product
Remember that security is not just prevention
Establish a threat model
Assume insecurity
Always validate user input
Turn on platform security
Use role-based authorization
Use SignedObject to provide integrity of Serialized objects
Use SealedObject to provide confidentiality of Serializable objects
Use GuardedObject to provide access control on objects
Aggressively release resources
Tune the JVM
Use independent JREs for side-by-side versioning
Recognize ClassLoader boundaries
Understand Java Object Serialization
Don’t fight the garbage collector
Prefer container-managed resource management
Use reference objects to augment garbage collection behavior
Don’t be afraid of JNI code on the server
Last modified 07 October 2024