• Post Reply Bookmark Topic Watch Topic
  • New Topic

what's the most popular "bitter" anti-pattern?  RSS feed

 
Andres Gonzalez
Ranch Hand
Posts: 1561
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I'd like to ask all of you guys, specially to Bob and based on experience, what do you think is the most popular error we, as a developer, make when developing J2EE apps (specially EJB stuff)? Does it happen during the design phase or during implementation? why are people not aware of these? is it because of lack of knowledge? what is the solution?
thanks
 
Chris Mathews
Ranch Hand
Posts: 2712
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The most popular (by popular I mean rampant) anti-pattern that I see in J2EE is using EJB unecessarily. That is not to say that EJBs are not useful, far from it. However, the vast majority of Web Applications do not benefit from the use of EJB.
 
Andres Gonzalez
Ranch Hand
Posts: 1561
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Actually, I was thinking more of something like:
"using remote interfaces to access entity beans, instead of local interfaces"
"transfer data betw client and server in atomic-way, without using a value object", for instance
[ August 13, 2003: Message edited by: Andres Gonzalez ]
 
David O'Meara
Rancher
Posts: 13459
Android Eclipse IDE Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Heh, we're suffering all of the above.
How about globally binding EJBs rather than in a local context (ie java:comp)?
We're about 50-50 "using ejbs when they're not really required" and "globally bound ejbs"
 
Chris Mathews
Ranch Hand
Posts: 2712
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by Andres Gonzalez:
"using remote interfaces to access entity beans, instead of local interfaces"

How about using Entity Beans at all, local interfaces or not?
Sorry, now I am just trying to cause trouble. :roll:
 
Andres Gonzalez
Ranch Hand
Posts: 1561
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
good point. But I think entity beans are not that bad. I haven't experienced this, but I've read that implementing a system with only entity beans is not a good idea. I'm not sure about this one, but I remembered reading that entity beans are good for read operations. So you can actually have a mixture of entity beans / JDO.
please correct me if I'm wrong.
 
Lasse Koskela
author
Sheriff
Posts: 11962
5
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I'm not sure about this one, but I remembered reading that entity beans are good for read operations.

What I have heard (a lot) is that entity beans are good for modifying entities but suck at reading a lot of data.
 
Chris Mathews
Ranch Hand
Posts: 2712
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Entity Beans only offer one thing: free persistance (I am of course only referring to CMP). All other services such as transactioning, security, remoteability, etc. can be achieving using a Session Facade.
Therefore, the question comes down to: Is CMP the best/easiest way to persist Java objects to a database? For me that answer would be no. I would much rather prefer to use an fully-featured O/R Mapping Tool such as Hibernate or TopLink and just throw a Session Facade on top of it if need be. Some people may like JDO, I personally don't think the 1.0 Specification delivers the goods when it comes to O/R mapping.
As far as read operations go, Entity Beans don't perform any better here unless you introduce an aggressive caching strategy (which can be done with tools such as Hibernate also). In fact, there is a pattern called Fast Lane Reader which is designed to circumvent EJB and use straight JDBC for some read operations because of the additional overhead in Entity Beans.
[ August 13, 2003: Message edited by: Chris Mathews ]
 
Pho Tek
Ranch Hand
Posts: 782
Chrome Python Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
What I have heard (a lot) is that entity beans are good for modifying entities but suck at reading a lot of data.

Which explains why you don't write an LDAP server using CMP !
Pho
 
Pradeep bhatt
Ranch Hand
Posts: 8933
Firefox Browser Java Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Does any server provide CMP supporting LDAP?
Originally posted by Pho Tek:

Which explains why you don't write an LDAP server using CMP !
Pho
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!