Several patterns exist for generating primary keys for your EJB application.
This month I'll provide a pattern for generating PKs that's scalable,
generic, and portable.
My format for defining the pattern will follow the catalogued layout
presented in the Gang of Four book, Design Patterns: Elements of Reusable
Object-Oriented Software.
Pattern:
UniqueID Generator
Intent:
Generate unique IDs for persistent objects in an EJB application
Also Known As:
PID (Persistent ID) Factory
GUID (Globally UniqueID) Manager
Motivation
Enterprise JavaBeans is a server-side component model that targets the
specific business domain of online transaction processing (OLTP)
applications. OLTP applications generally have the need to store information
persistently. The data records or objects for each transaction require unique
identifiers to allow them to be stored and retrieved accurate... (more)
Discussion groups have recently been abuzz with talk of "coarse-grained
entity beans" - a slight misnomer deriving, I suspect, from the addition of
mandatory entity beans in EJB 1.1. This month I'll examine the finer points
of the Enterprise JavaBeans specification regarding coarse-grained entities,
as well as my own, and provide an example for you - with plenty of comments
to provide food for thought when you tackle the challenge yourself.
For those of you who finally came out of your Y2K shelter, EJB is a
specification for building server-side business components on the Java
p... (more)
In the March issue of JDJ (Vol. 6, issue 3) we discussed the basics behind
J2EE security, including coverage of role-based security for both the Web and
EJB tiers. In Part 2, we provide an example of implementing J2EE security in
the WebLogic Server.
While this article and the examples contained within are specific to WebLogic
6.0, all of the deployment code and standard descriptors should be portable
to any J2EE-compliant server. We won't cover encryption and SSL this month,
as they're articles in their own right.
Trader Application
How many securities trading examples have you ... (more)
Often we think of security as a burden, a time-consuming process that
requires us to jump through hoops just to get through a doorway or view a Web
page on the company intranet. My first real appreciation for (or frustration
with) security came a number of years ago. I was a PowerBuilder consultant in
Minneapolis, helping the Federal Reserve Bank build its first-ever
client/server application. Each day it was a hassle just to get past the
security desk in the lobby, and the bombing of the World Trade Center in New
York that year did nothing to ease the pain.
My next interesting ... (more)
What's all this hype about portability? Portability has been a hot topic
since Java's arrival just a few years ago, so I'm going to devote some space
toward understanding portability issues centered around the Enterprise
JavaBeans architecture and development. This month I'll discuss the various
types of portability and Java's relationship to each; then I'll touch on the
portability goals of the EJB specification and where EJB portability lacks
maturity (and why not to worry). Next month I'll provide tips on EJB
portability as well as code examples depicting how you can help achi... (more)