Win a copy of Reactive Streams in Java: Concurrency with RxJava, Reactor, and Akka Streams this week in the Reactive Progamming forum!

Patrick Nolan

+ Follow
since Oct 03, 2003
Cows and Likes
Total received
In last 30 days
Total given
Total received
Received in last 30 days
Total given
Given in last 30 days
Forums and Threads
Scavenger Hunt
expand Ranch Hand Scavenger Hunt
expand Greenhorn Scavenger Hunt

Recent posts by Patrick Nolan

Perhaps you should consider using CMP entity beans for your create, update, delete operations. This will give you container-managed transactions, which really makes life easier for these operations. (On a side note, I implement read operations using straight JDBC because it is so much faster - at least with 9ias. But for create, update, delete I take advantage of the container transaction services). In your ejb deployment descriptor (ejb-jar.xml), use the <trans-attribute> to set the type of transactional behavior. Setting this to "Required" for all methods involved in your transaction will give you the "if one fails, all fail" behavior. Like the previous poster mentioned, read up on ACID.
Patrick J. Nolan, Jr.
Rashmi, I like using UUIDs as PKs in complex enterprise scenarios. For example, you have 5 enterprise systems scattered around the country and these systems are integrated using EAI. Two of these systems are able to create employee objects. How do you guarantee that each system generates unique primary keys for the employee objects that they create? Answer: UUID. UUIDs are very handy in this way.. and remember they are always unique across space and time.
UUIDs generated in the application allow faster row creation in that it is not necessary to hit the database twice in order to insert a record.
There are caveates however. What if you want to run a script to insert records into the database (such as in data migrations).. how do you create the UUID dynamically in your db script? Now you have to duplicate the logic because the application only knows how to create the UUID. There are ways to handle this, like in some DBs (ie Oracle), support java in the database so you could hook into your UUID generator class from your db script (see:
Frankly, I don't agree that PK generation must stay in the database. DBAs will probably argue with you on this (so be prepared to justify your position
I have implemented several enterprise packaged solutions that use UUIDs and I can't say I saw any database performance issues due to their use. Also, FYI these were VERY high transaction volume systems.
Patrick J. Nolan, Jr.
I would suggest you look into using a UUID as your primary key. This means universally unique id - it can be generated in the application rather than the database and is generally a string, not a number.
So.. for example, let's say you have a cluster of ejb servers which comprises 2 app servers, each on its own physical machine. Obviously, each app server in the cluster must be able to generate a unique id for inserts (ie ejbCreate()). This can be done by concatenating the following: HOSTNAME + TIME IN MS + EMPLOYEE SSN. I'm sure you can come up with a better combination for the UUID, but you get my point.
For simplicity's sake, I left out such details as Session Facades... but thanks for your input. Now, back on the topic of distribution. The app server is 9ias, but I didn't think that mattered, since distribution is part of the J2EE spec and thus applicable to all j2ee servers(?). I *did* find examples of how to put the entire ejb jar on a different server.. but what I want to do is somewhat different. I want to have some ejbs on one server and other ejbs on another server. I didn't find anything on how to configure that.
Here's the scenario..
App Server A has Entity Bean A
App Server B has Entity Bean B
App Server C has POJO C (acting as a DAO)
I want the entity bean implementations to remain on their respective servers. I want C to access remote interfaces of A and B and perform typical CRUD operations on each. How does C access entities A and B? Do I need to have A and B code on App Server C? If so, how must it be packaged? All I was able to find out is how to configure the rmi.xml on each of the three servers so that they can communicate. That's as far as I got
I respecfully disagree I think UML diagrams are ALL (or at least mostly) about communication. What is one of the first things you do when you are asked to add features to an application with which you have no prior experience? I believe the first thing most of us would do is study the class diagrams and the sequence diagrams for that application. The diagrams are clearly a form of communication - the original developer is communication his design via UML to the rest of his/her team.
Patrick J. Nolan, Jr.
Two approaches from different gurus on the subject:
Floyd Marinescu
Presentation -> Application -> Services -> Domain -> Persistence
Eric Evans
Presentation -> Application -> Domain -> Infrastructure (Services & Persistence)
You can see here that Marinescu says Domain should be "underneath" Services, whereas Evans believes Domain should be above Services. I personally prefer Marinescu's scheme where the Services contains the knowledge of 1) how to persist a Domain object, 2) how to integrate persistence operations with other systems (ie sending async messages). However, isn't the following representation more consistent with Marinescu's layering?:
<---- Domain ---->
Presentation -> Application -> Services -> Persistence
The Domain layer is used across all layers and contains data and business logic/behavior. For example, it knows nothing about databases, messaging, or JNDI lookups. I do not like Evans' approache because his Domain objects contain a little persistence logic (e.g. "commit()" methods in Domain objects).
Any thoughts?
Patrick J. Nolan, Jr.
What I found is that ArgoUML is pretty much the only game (ie best) in town as far as open source / free UML tools go.... and unfortunately, it is very much in the beta phase. Like a previous poster said, pencil and paper are the best tools for diagramming .. but I think this really only applies when you are designing an architecture by yourself... If you need to communicate your architecture to outside consultants or to the rest of your internal team, it pays to have a commercial tool that can do the job well.
Patrick J. Nolan, Jr.
I am currently creating a rich domain model at work and I have repeatedly come across a problem. There must be a common way of dealing with this, as I imagine it is a common situation. I will try to explain it with a simple domain model example:
Domain classes: Person, State, County
State has many counties
Person has many states (assume all people have residencies in multiple states)
The Person class has the following properties:
name : String
eyeColor : String
states : State[]
State has properties:
stateName : String
counties : County[]
The problem here is that when a Person has a residency in a state, it is in ONE county.
In the context of an association with Person, state should have one County. But when I add State as a property of the Person object, I get a State that can have multiple Counties. This is the problem I want to correct in my design.
Now, the only solution may be to only add one County (an array of one) to the State object when I create this family of objects, but this seems like a "duct tape" kind of solution. Any ideas?
I am architecting a suite of web applications that must be "skin-able". Essentially, I need as much flexibility as possible with respect to runtime variation of the presentation layer. Has anyone here used Xkins? Any thoughts on this open source product? Have you used a technique/product in the past that has worked well for skinning?
Patrick J. Nolan, Jr.
I am having a hard time understanding SFSBs. I would like to maintain state in the EJB tier, but it doesn't seem to work that way when the browser is the ejb client. It looks like I have to create a SFSB and store a reference of that in the HTTPSession - is that correct?
For example, with the typical shopping cart example, a user adds a product to his cart. Then, jumps around the site to different pages and decides to add another product. This action should add a product to the same instance of Cart object that he used previously. I can only get this to work if I store a reference to the one SFSB instance in the HTTPSession.
If I don't do it this way, and instead get the SFSB by calling ejbCreate() each time a product is added to the cart, it gives me a newly instantiated Cart object. In other words, It doesn't contain the products that was added earlier...
I am totally confused because books/articles talk about using HTTPSession vs. SFSB for this purpose --- but they appear to me to serve different purposes entirely.
So, is using the HTTPSession to store the SFSB reference the only way to maintain ejb state across multiple page navigations (e.g. http requests).
Can anyone point me to a link/book/article/etc that explains these concepts? I didn't find anything in Sun's SCEA study guide and a search on their site produced nothing worthwhile.
We have Oracle 9ias and I am trying to figure out what the best option is for data access. Can anyone comment? The dilemma is 9ias didn't come with a JDO implementation, only TopLink. I am concerned that TopLink is proprietary and will fade away as JDO implementations gain ground and take over. I am considering something other than CMP entity beans because they are just too damn slow (even with local interfaces and DTOs). And.. BMP is a pain to code.
My requirements are this: Data access/updates must to be FAST. The web apps using JDO or TopLink will support hundreds of transactions per second. Also, at some point, will have to distribute them among among a cluster. Our data model is well-designed, but very complex. The objects should make traversing data relationships easy and fast.
Until I can make an informed decision, I will just rely on an absraction layer over the domain layer and continue to use CMP and JDBC where each is appropriate.
I'm totally confused. I picked up "Applied Java Patterns" book, hoping it would give me a better understanding of patterns than the Smalltalk loving "Design Patterns".
I understand the importance of programming to an interface so that the actual implementation details are hidden.. thus increasing code reuse. However, what does the AbstractFactory class have to do with that? The example in "Applied..." is so simple that the concrete AbstractFactory classes seem uterly superfulous.
Can anyone explain this to me?
I just wish some book would show a complete, and complex, example of the patterns.
First let me say that I am just learning about J2EE and security. I've only used form based authentication against a typical "user/password" db table, with programatic security checks sprinkled throughout the web tier code. I want to get away from this poor design.
I am confused about how all this works. If I wanted to use declarative security:
1) what is the typical platform independent technology used to store and manage actual users? How does LDAP fit with this? How can this work with an application that allows web users to change their passwords?
2) What is used as the "glue" between some user management technology and the J2EE security infrastructure. I see how principles and roles can be created, but I don't understand how user "johndoe1" is assigned to role/principle.
15 years ago