Bitter EJB
However, every coin has two sides: the other side of "freedom of choice" is "complexity". Although EJB is an incredibly powerful tool in the hands of experience architects, it is subject to a lot of misuse by novice developers who do not make sound choices. For example, some developers might use a BMP entity bean to map each database table in the system; or access entity beans directly from a distributed layer; or store large amount of data in session objects ... The list goes on. Although those approaches are technically possible, they are hardly the most efficient ways in most cases. Such problems have not only caused many projects to fail but also tarnished EJB's reputation. In fact, the complexity of EJB is often quoted as an argument for other enterprise platforms.
For EJB developers, it is crucial to learn from other people's experiences and follow proven best practices. That helps to reduce the complexity of the platform. Manning's "Bitter EJB" is a very timely book written by well-known experts in the EJB field: Bruce Tate, Mike Clark, Bob Lee and Patrick Linskey. Unlike other "architectural" books, Bitter EJB teaches best practices through common mistakes (anti-patterns). It focuses on "what not to do" but still encourages developers to come up with liberal (everything not forbidden is OK) and innovative solutions. After all, EJB is about flexibility and freedom of choices.
Part I of the book is an overview of anti-patterns in the EJB specification. The EJB specification itself has several major design problems when it first came out in March 1998. EJB v1.1 and v2.0 have gone great length to fix the anti-patterns in the specification. But early adopters may have already developed some anti-patterns in their applications. For new developers, the history also serves as a valuable lesson on what EJB is really for and how different components in the specification fall into their current places. In this part, the authors also provide an excellent recount on what went wrong in the high profile TSS Java PetStore benchmark.
Part II is about session and message-driven beans. Those beans are mainly used in the integration layers. Topics covered in this part include how to deal with large database results, whether to maintain session states, the limitations of XML and much more.
Part III covers EJB persistence. Entity EJBs are probably the most confusing types of components. Many experts have advocated to abolish entity EJBs altogether in favor of other simpler persistence frameworks such as the JDO or even simple JDBC facades. The authors discuss the pros and cons of entity EJBs and covers most leading alternatives. For those who must use entity EJBs, this book also offers useful advices on a range of topics including how to reduce round trips, shorten primary keys and handle expensive database joins etc.
Part IV covers broader topics including performance tuning, testing, building and packaging. One big problem that even EJB developer can recognize the complex deployment descriptors. One chapter of the book is dedicated to reduce code duplication, automate the deployment process and avoid the "integration hell". The last chapter of the book provides an overview of "what's next" in the EJB space.
Overall, it is an excellent book for all EJB developers and other enterprise developers who want to learn from the successes and failures of EJBs."
Peter Wayner's review:
Although there may be as many 36 plots
in all of literature, the compartively new world of computer books has really had only one: this new technology is simple, very
simple, and it will make your life better and your teeth whiter. Bruce
Tate opened up a second plot in his book Bitter
Java by exploring just how even the best programming ideas have
dark sides. Now he's back with three other authors exploring the world
of Bitter EJB.
This book is more fruit from the same tree. Or, to hack the Java MemeStream even more, more beans for the same mill. If you use Enterprise Java Beans (EJB), or think about using them, you should read
this book to see what can go wrong. The title shows how naming schemes can be misleading because either the authors aren't really
that bitter, or because they're focused entirely on EJBs. This book does not belong in
the same camp
with the Java==SUV crowd. These authors are really admirers who just want to warn people how to avoid problems with Java and EJB.
Tate and his new co-authors, Mike Clark, Bob Lee, and Patrick Linskey are all
consultants who seem to use Java a lot, at least when they're not cheating death. One of the cuter grace notes in the book is a collection of war stories from extreme sports that are mixed in as an allegorical taste of what's to come. Before exploring the problems with a Java concept known as enterprise beans, they tell a kayaking story
that ends with the sentence, "Then we hear a loud crunch and look up to see Eric's stern stationary at the top of the drop, revealing the
sitaution that every kayaker dreads the most -- the vertical pin."
After stories like this, the book goes on to explore just how the
very fancy enterprise beans toolkit can produce an application that moves slower
than a stream filled with honey. Each chapter is filled with antipatterns, or lessons about the software learned the hard way.
They're sort of like points on the map that say, "There be dragons here."
The book is divided into four parts. The first section, termed "The
Basics," explores the simple ways that EJB technology goes bad. The
toolkit was heavily hyped as the perfect solution for building business websites that interface seamlessly with large databases. As the business
grew, new servers could be added without grief. Alas, as this
section points out, there are many reasons why an elephant gun can be
the wrong weapon for getting rid of mice in your house.
The next section on "Networks and Messages" describes how good ideas
can turn into slow code when people misuse the fancy tools for scaling
EJBs. In theory, the EJB toolkit will split up processes simply across
multiple machines to handle more customers, but in practice all of the
communication can slow things down considerably.
The section on "EJB Persistence" describes how the much-hyped system
for seamlessly storing away enterprise beans in databases can weigh
down a system. My only beef is that they left out much information on Prevayler, a much-maligned and
misunderstood ultra-light toolkit that is like an anti-EJB persistence
layer in every possible way. I'm enamored with it, if only because it's
such a radical move away from the monolithic APIs like EJBs. While they
liken using EJBs to snowboarding in fresh powder with a 100lb pack on
your back, Prevayler is sort of like boots-only hiking.
The last section isn't about EJBs per se, but similar toolkits and
projects that often get used with EJB. There are antipatterns to avoid with JUnitPref and Ant, too. Some of these suggestions, like some in the rest of the book, aren't terribly new or brillant, but it can't hurt to get another lecture on the importance of testing your code.
The book shines when it's exploring what goes on behind the slick facade of the API. Sure, the EJB toolkit will dutifully load up data
from any object on any server in your farm, but you better be careful invoking some of these these methods because the network is slow. The
book often points out how invoking that one simple method from the sales literature
can start up dozens of sluggish threads. Peeling away the layers helps
understand and explain why the system fails.
Many of these lessons aren't limited to Java or EJB. I wouldn't be
surprised if the group of authors was busy rewriting the book with examples from .NET. Unfortunately, some programming problems are very
hard, and building a toolkit with a simple API won't make them go away.
In fact, the simple appearance can cause more trouble when the
programmer can't understand what the secret mechanism inside is doing.
Almost all of the problems in this book arise from programmers who
believe the sales literature when it tells them not to pay attention to
what that little bot behind the curtain is doing. If you're working
in the world of EJB consulting on big iron, then you've got no choice
but to start thinking about what's behind that curtain.
You can purchase the Bitter EJB from bn.com. Slashdot welcomes readers' book reviews -- to see your own review here, read the book review guidelines, then visit the submission page. Peter Wayner is the author of 13 books including Java RAMBO Manifesto and Translucent Databases.
I do agree with the title of the Book. EJB, especially EJB 1.1 and EJB 2.0 are def. very HUGE specifications and as hard to learn as UNIX. You have 1000's of choices which lead wayward programmers easily. Contrast this with M$FT which provides a clear Roadmap and expands complexity slowly to grasp them easier. EJB is like being pushed into the Q Continuum when you are a mere biped and not an omnipotent. It is too huge for you.
-------- Cluster bombing from B-52s is very, very accurate -- the bombs always hit the ground.
This article reads more like a summary.
At least the novice developers can use it. Look at Visual Basic: VB is the most popular language with over 3 million developers simple because anyon can pick it up and get started, this leads to more developers, which leads to more apps, which helps Windows dominate the desktop.
Now a large number of those first projects are garbage apps, but at least they give a starting point. We need languages that novices can jump into, then good books that can help steer them as they continue learning the language.
For a review, this seems a bit short.
A quick overview of what is contained in the book is informative, but not necessarily insightful.
Gotta point that out; sorry for nitpicking, but I like book reviews to tell me not only what's in the book, but how good the book is.
Principals of Slashdot and OSDN may have investments in the stocks of the companies discussed on this site and will disclose any interest if they are posting a story about those companies or their products. Contributors to this site may or may not have an interest in a company or product they are discussing. The decision to disclose that information is theirs to make. We do not guarantee the veracity, reliability or completeness of any information provided on our site or in any hyperlink appearing on our site.
Write better summaries and your subversive marketing might actually qualify as subversive.
Laws are for people with no friends.
For those you who aren't boycotting Amazon:
Ref: Amazon has this book for $4.50 less than bn and with free shipping
From the header
almost everything can be done in several different ways
I guess imitation is the finest form of flattery but I think they might be violating perl's IP here.
If I used EJBs, I think I would buy the book. Addressing the anti-patterns first is good, because EJBs won't save the world. But, they are very powerful in certain applications. Many posters have simply stated that EJBs are hard to develop and slow in performance. Some of these claims are true, but reasonable performance can be achieved by being smart in how you use beans, and that's what this book helps you to do.
I'm also glad the book talks about the failed TSS PetStore performance shootout, although I'm curious about how it's presented. Suffice it to say that PetStore really isn't (or at least wasn't then) a good example of the way to do things.
And for those complaining about the difficulty of EJBs, many AppServer vendors provide development tools that make coding EJBs very easy. Although, these tools tend to be really pricey.
How many people have had really good experiences with EJB's? In over 3 years of doing Java development I have yet to hear anyone say anything good about developing with them.
The vast majority of people who I have talked to seem to indicate that they have never come across any project under development where using EJB wouldn't be complete overkill, and that much simpler, easier to maintain, and cheaper solutions seem to be the path chosen.
These aren't all small projects either, I would venture to say all of the people I have spoken with (or projects I have been working on) have been in the $50,000 - $2,000,000 range, and none of the senior developers or architects on these projects have ever dreamed of going anywhere near EJB.
Thoughts?
java guy, tech blog...
Back to the Future, Part I, describely pretty plainly how to acheive recursive multivexed field divisions-- simply go to 88 MPH with a Flux Capacitor hooked up to your alternator (GREAT SCOTT).
At least the novice developers can use it. Look at Visual Basic
:)
I find it funny to see your domain address.
j/k
Open Source Java Web Forum with LDAP authentication
Well, what can I say, I have a niche to fill.
A system with complex rules isn't necessarily more powerful, but it's usually more difficult and error prone.
Unfortunately this misconception is very common in computer science. People tend always to create complex APIs/infaces and protocols just to get a "powerful tools". The result is the security and error ridden state of the internet and computers we see these days.
Strangely other hard sciences have seen these problems decades ago (sometimes even centuries ago) and changed their terminology and fundations accordingly. Take e.g. Mathematics with is based on 2nd order logic and set theory. And this started with Godel, Riemann, Abel and Gauss about 120 years ago. We have the same drive now in Physics with Wolfram and co. propagating simple cellular automata. Some people in string theory move in this direction, too.
Unfortunately computer scientists seem to be immune to this amount of common sense right now. Perhaps they need some centuries of fumbling aroung with overly complex model, too, until they get back to earth.
Owner of a Mensa membership card.
For example, most GUI toolkits. Usually, you follow the examples and tutorials as a model, you read through the API docs, and you can build a system that works pretty well. Even many other kinds of enterprise software infrastructure - take TIB Rendezvous, or similar messaging systems - I've written apps with many of them that scale, are efficient and work well on the first try.
I've seen several EJB apps written, and worked on a few myself, and you can read all the damned API docs, follow Sun's examples, read your app server documentation, and so on, and still, you just shoot yourself in the foot. This isn't the first book on patterns and anti-patterns of EJB usage, it's the umpteenth. Why? Because the EJB model was so poorly thought out prior to its implementation that if you follow the specs and build the kind of system they _seem_ to want you to build, it just doesn't work.
Instead you need to have built 10 systems that don't work before you have a clue how to make one that doesn't. Frankly, it seems to me like more trouble than it's worth for what you get (which is basically transaction-aware objects, at least based on my knowledge from the EJB 1.1 era). If you just use session beans, if you don't use entity beans, if you don't do distributed transactions, if you don't use stateful session beans... then you can build an app that works.
Great. I think the J2EE APIs have a lot of great, great stuff in them, but EJB just tweaks me out. Why the hell didn't somebody try using this hunk-a-junk before they released their 1.0 spec, or maybe their 1.1 spec, or howzabout the 2.0 spec? Maybe things are better these days, but if your API looks like it's supposed to provide a pattern for enterprise database applications, shouldn't it actually do that, or somehow redefine what the hell it's really supposed to be for?
Bitter beans, bitter coffee.
WTF?!! Didn't this guy read in the slashdot reviewers' guidlines that all reviews are to give a rating of "8"?!!!
Ironically, VB programmers have the best hygiene of any computer programmers. That's because after a day working with VB, they feel like they need a shower.
It's gotten to the point where people don't think you're doing "J2EE" if they don't see EJBs being used. If you don't need transaction isolation over a distributed system, EJB is overkill.
The infrastructure for those systems are hard to write. The whole point of EJB is to have as much underlying general purpose infrastructure as possible already written for you, so you can plug your ad-hoc business logic on top. This puts development of these systems in the reach of a greater number of developers. But if you can write it yourself, you'll be better off. You'll be in control of more of the code, and won't spend your time messing with tuning parameters and configuration files for someone else's code. One exception is a distributed transactional system where it simply gets to be too much for you to reach your deadline. The other is a system that might be integrated into a larger system like that, that is already based on EJB. (Or the customer might be requesting EJB, maybe for a good reason.)
I sat in on an interview once where we were explaining the architecture of a server product we sell, and the first thing out of the interviewee's mouth was "You don't use EJB? Oh I'm surprised- you should really be using EJB!" That killed the interview right there.
Does anyone else think that it is messed up to create one framework that is suppose to handle business logic AND database persistant objects?
Whatever happened to making frameworks that do one thing only and do it well?
No, we don't. We should make it harder for newbies to jump into programming. This would drive programmer salaries higher, since there would be less competent programmers.
Don you want to be a scarce resource? It's simple economics. ;)
Not just for novices. I'm a "graying ponytail." I cut my teeth in real programing on an IBM 360 in APL. Selectric as the i/o device. "Changable fonts" by changing the typeball and all that.
I'm hardly either command line nor dense mathmatical code shy.
Today I'm a bit of a C+Python snob, but I went through a VB phase when making the switch to graphical shell programing. It was like magic. It got me up on my feet and running, producing really usable apps in the Windows enviroment in no time flat.
I "outgrew" it in fairly short order, but as a stepping stone between "old world" and "new world" I found it invaluable.
KFG
I like my coffee like I like my women...
Bitter.
Stop by my site where I write about ERP systems & more
I'll give you that tools have been lacking in the Java Enterprise world. Most of the good ones allow experienced developers be more efficient, and few really give the novice programmer a leg up.
.NET client written by an offshore team and our in-house JBoss based J2EE app. We expose the EJBs via both local and remote interfaces to other Java apps and via SOAP to the .NET client.
.NET developers how no idea how to use inversion of control patterns for managing network connections and no idea how to use SOAP efficiently. They make common mistakes like unnecessary calls, which are expensive in SOAP and not caching data properly on the client.
The biggest problem facing EJB and all of the major environments right now is not how easy it is to work in an environment, but how well the developer understands distributed components and n-tier architectures. Look at SOAP, I've worked on a couple of projects that involved SOAP, the most recent is a
The problem is that the
Quite frankly, given the problems I've seen with this and other SOAP projects, I don't believe that SOAP offers any advantage over CORBA. The biggest claim SOAP has always had was that it was easier than CORBA, but what I've seen is that developers still have to learn distributed components and that was always the hard part of CORBA. Distributed component mistakes in SOAP become an order of magnitude more expensive than in CORBA due to the XML bloat and the processing power needed for serializing/deserializing SOAP.
This holds true for things like EJBs and other J2EE components (MBeans), if the developer does not understand the basic principles of distributed components, they will write a bad app. It doesn't matter the environment or how "easy" the tools make it for the novice, writing something other than garbage in this environment takes fundamental understanding of the problems involved, which is not covered in depth enough in most of the books and typically takes some experience.
That being said, learn distributed components and n-tier architecture. I'd recommend Java precisely because the complexity that the novice sees will hopefully allow them to see the causality while they learn distributed components. The patterns will start to emerge after a while. Then it won't matter what language or platform they use, they'll know how to write distributed components and the infrastrucure required to run them.
Once they learn these patterns, they can then use tools like XDoclet to quickly automate the tedium and repetitive bits needed to make the system work. Also, all the tools needed for learning this and building productions systems are available from the Open Source world (minus a JVM), so no vendor lock-in.
To summerize, I don't think it's the language they need to learn, it's distributed components and their infrastructure, the language won't teach them much.
Arrogance is Confidence which lacks integrity. -- me
"Besides, use
Oh sure, and when M$ decides that they need to sell yet another language you can write, whatever, again in WinFX. Maybe all those VB programmers that were layed off because of
That's how every good slashdot troll should begin. But if there is one technology that is currently at real risk of extinction in the Java world it is EJB. Almost every new J2EE project that I hear about steers clear from EJB towards simpler solutions such as plain servlet/jsp with JDO for persistence. Then you scale it horizontally through mod_jk or a hardware load balancer. No need for confusing (and restrictive) enterprise beans.
Entity EJBs have been critisized many times and rigtfully so. Session beans I find are OK but for me (and my company) it's a case of "I really don't need them given the baggage of complexity and the restrictive nature of their API.
Message driven beans are probably worthy of consideration but there isn't that much to them really. Certainly not something you couldn't implement on your own with plain JMS. I've done it, didn't take much time and it worked just as well as the specc'ed MDBs. And I don't have to run within an EJB container. I can deploy to Tomcat and have SonicMQ running remotely.
Is EJB going to really take off? Seems that the spec was vastly improved but not all problems with the technology have been addressed and then there is the phsycological issue for many developers who had nasty experiences with EJB 1.1 development.
I won't trash EJB they are a certain way to develop enterprise applications. I just find that I end up with much simpler design if I avoid them in lieu of something simpler. My preferred stack at the moment (assuming no legacy systems to integrate with) is as follows:
- Struts
- Hibernate
- GLUE
- Tomcat
- JDOM
- SonicMQ if I need messaging
- Good DBMS
And I'm good to go. Look Ma, no EJB!Your pizza just the way you ought to have it.
To Bitter Java, Bruce Tate's previous and somewhat less targetted book. I read this book and it was absolutely fantastic-- I would recommend it, and based on the pedigree I would say this new book is probably worthy of recommendation as well.
:(
Bitter Java went in exquisite detail into the various ways things can go wrong in Java development, and in Java-like languages, in an attempt to teach good design by counterexample (most of the book concerned real-life examples of what they called "antipatterns"). It is one of the better books on OO design I've come across. Unfortunately I accidentally left my copy on an airplane somewhere between Indianapolis and Dallas
Irritable, left-wing and possibly humorous bumper stickers and t-shirts
Every failed EJB based system (and many failed non-EJB systems) that I've seen had poor database schema design at their heart. In almost every case, engineers familiar with OO design, didn't really bother to learn anything about RDBMS, perhaps because they felt them to be old-fashioned, and tried to ignore the database as much as possible, and put too much logic outside of the database.
There's a lot to EJBs, sure. But you first have to learn the basics of good database design, for without that, you are hosed.
If there's a benevolent god in this universe, you'll be going to hell for that sentence, Peter Wayner.
However you are correct in the sense that most of the people using EJB's have no clue of whats an "enterprise" application: they think that because their building a banking application (or worse a large website) that they are building an enterprise application. Most people I see using EJB's have no idea whats ACID let alone XA, they sometimes know what 2pc means but only its initials and not how it works.
EJB's depend a lot on the tools as well I personally think WebSphere sucks, it looks good but it was just badly designed.
EJB's were technically designed to be developed by novices using GUI tools that will abstract the complexities. Some of these tools actually work very well and you can get a team of novices to produce a great EJB application (since writing EJB's with a tool is REALLY easy) but when you hit the snags (since no current tool works correctly and usually you need application server tuning) then you need a REAL architect to step in and fix things.
Most people just use EJB's for buzzword compliance which regretfully causes the tons of FUD we see about them today.
EJB's were designed for GUI tools (this is very clearly mentioned in the spec) but people keep writing them by hand because the tool vendors did a relatively poor job. They are however getting their act together and newer versions of tools from Borland are rather good, XDoclet is nice but its a far cry from simple.
The mistake that was made was in relying on tool vendors that just made a mess of everything.
J2EE really wanted to be implemented in ruby, or Python if that's your thing. it is so obvious.
J2EE is as ridiculous as the complete over-abuse of XML (Jelly and XSL comes to mind).
One of the reason EJB's are problematic is because of the missing things in the spec for vendor extentions that cannot be within the standard since every vendor implements them differently.
EJB 1.1 sucked ass for medium sized applications and didn't offer much.
You shouldn't have this problem with a decent application server supporting version 2.x (such as jboss, but not WebSphere).
I expect Java to drop the hype in 3-5 years completely and be where Ada is now.
I expect more hype coming to Python, especially once it gets some EJB-like "Twisted" framework. Or Erlang with its enterprise-quality EJB-like OTP framework.
The time of dot-coms, when C{E|I|O|T}O never planned expenses, has gone. So will the time for Java/EJB over-hype.
Less is more !
Without a more effective query semantic, prevalence will be limited to a very small subset of the problem space currently solved with O/R solutions.
The knowledge gap appears to be in the analysis of the value of SQL queries in programming and computational problem solving. My assertion: relational programming is actually different from object oriented programming and is more useful than OO for a number of problem types, including asking ad-hoc questions of the data set (very common for reporting, etc.).
This feeling, that SQL and RDBMS's are somehow a "throwback" or an "obsolete" technology reveals a lack of understanding of the relational programming model. This feeling has also led to a lot of "trips around the block" (Yet another OO database, etc.). OO databases don't really catch on for anything because they don't solve real world problems better than relational DB's. Yet time and time again, OO databases are trotted out as the "road to freedom from SQL". SQL, appropriately applied, isn't any more confining than Java or any other programming language, appropriately applied. Unless you take a close look at one of the problems that SQL solves elegantly, however, this statement will not make any sense to you.
Based on my experience, the biggest differences between the OO model and the Relational model include:
Basically, I accept the prevaylance performance numbers, simply because I can make any decent RDBMS perform queries 3000x to 9000x slower than nominal on a sufficiently large dataset by screwing around with the indices. What I don't accept is the claimed significance of your numbers. Who cares if your system is 9000x faster than Oracle + O/R for your carefully chosen example problem if my real world problem is 5x faster but requires 100% more java code and can't easily handle new report types? Most of the time, performance is one of the last aspects of a new system to get any attention, and IMHO, that's exactly the right emphasis for performance in system development.
Let's propose a real business application with dozens of objects in a complex model and then throw a few million instances at it. Now let's start adding queries to the system and let's see who does better? I'll bet that I don't have to try very hard to get the queries 1) written faster and 2) executing faster against the O/R layer than you do against the objects in RAM, but then since I'm choosing the dataset, you know that's not going to be too difficult :)
I'll freely admit that you guys have some really cool ideas, and I *really* like the idea for small apps that already use files for persistent state. Only problem is that none of the products I've worked on in the last ten years fit a mold that prevalence would make easier. If anything, your approach mak
>For me, it's very nice having most of the Unix techniques I learned in the 80's still be perfectly useful now. Two-edged sword; it can be either because the techniques are simply optimal and need no improvement or because we can't think outside the box and come up with better ones yet.
Marxist evolution is just N generations away!
That's ok, but how can you simplify distributed, parallel, scalable, fault tolerant applications with asynchronus messaging? It seems to me that the domain of the problem is complex on itself, and the tools somehow reflect this complexity.
"I think this line is mostly filler"
I've been doing J2ee development for the last couple of years and on the whole I don't think EJBs give you many advantages but they do add a lot of confusion.
The main problem is that it isn't clear the best way to use them, there are so many techniques and patterns out there but there is nothing you can point at that is the 'best practice' - it all depends on your application.
The advantages of easily scalability of business objects over multiple servers is useful, but since the database is the main bottleneck in most enterprise applications the scalability of the business logic layer doesn't give you a lot. Also many applications require communication between the various clients (through the server) but since EJBs are designed to be location independent, there is no nice ways of communicating between session EJBs on various machines. It is possible to do it with message EJBs but it's not easy. Another thing to note is that you don't need EJBs to separate the business layer from the presentation layer, it's easy to do with normal classes. You also don't need EJBs to have the business logic running on another server - you can just use RMI.
The automatic EJB transaction management is useful but since it relies on exceptions being thrown and it can get very confusing, and often isn't flexible enough - we seem to resort a lot of the time to UserTransactions.
On top of that a complex database schema seems also impossible to map to Entity EJBs in a useful way. We have 300+ tables and the presentation layer needs all sorts of combinations of relations between the data that mapping the data into 'Entities' just seem to make data access inefficient.
I went through that VB phase too. In those early days when OOPS was just getting more popular with C++ , I had been doing some teaching with Smalltalk as well.
It took awhile to realize (after coding 25% of an app) that the computation model of VB was anti-OOPs.
With the objects being forms. With data objects public and the associated fuctions private. That is the fields of a frame were public but the methods of those fields were private and not triggerable from outside pushing the buttons.
So to make things sane and OOPS you have codepages that were the OOPS interface to a forms, associating one code page (might be called something else its been a long time) with one form to have a semblance of a OOP design. VB at the time claimed to have inheritance but that was only for control groups and turned out to be empty marketing. It claimed to have polymorphism but that was only for variables that were control types, again marketing hype because of the limited nature of the exising facility. No encapsilation whatsoever. So you ended up doing the kinds of things we did prior to OOPs to get the benefits of OOPS.
It would not have been so bad if VB at the time had not been billed as a OOPS 4gl. That was the problem. If they had only had a clear concise description of the computation model used then us experienced programmer could have molded our solutions to the language. A little change in computation model or name visibility can strongly effect how you solve problems.
VB now has more features that are OOPS friendly as far as it goes.
So you (as I) having switched many times between models are more facile at doing that and understanding that.
Those "developers" that learn on a language that is not well explained can end up like I am sure you have seen with IBM Cobol programmers that learned on the job, crippled for life to think through problems in only one way.
It is good to cycle through a series of models to get a sense what can be done and to know what deficiencies to complain about, and how to code around them, not letting the language control you.
EJB's I think are off the map in terms of start up complexity and that is what they have to work on next. They are starting to address that with meta data in Java 1.5 but we need an EJB lite. That would be development scalable not just application scalable.
a directory by any other name is a folder.
...something like:
Cabin Attendant: Cofee?
Little girl: yes please,
CA: How do you take it?
LG: Strong and black, just like my men.
God bless you, sir.
EJB uses OO centric ideas, which tend to neglect data modelling. Class modelling is what its all about, data is not at the center.
You see it in the idea of entity beans that encapsulate data, and the higher layer of session beans that encapsulate process (i.e. business logic). It encourages you to not use RDBMS business logic (such as constraints, triggers and a sound datamodel).
Lighter approaches such as the simpler "model-2" servlets, using plain JavaBeans as data access layer much more leads you to put more emphasis IN the database and less in all kinds of layers outside. It leads to simpler and more robust systems with (generally) better thought out datamodels.
The problem is that most Java developers have lost their "Beginner's Mind."
You can see the evidence of it in my previous post criticising Java for its complexity. Experts who already understand it post 10 lines of "Hello World" code and say, "See? Nothing to it! If you understand it it's easy to understand."
Well Duh. That's what I said.
But you can't start understanding it by understanding it. It ought to be a truism that you start understanding something with a lack of understanding and have to build up in steps.
Java makes little to no provision for taking those steps. It's a real problem.
I also think there's something of a problem with Java programers ending up crippled by the enviroment themselves. It isn't the only way to go about solving problems, and neither is OOP.
KFG
I did a project in VB where I had to convert an old BASIC program to VB. I had no VB experience and it took no time at all to do the conversion, and give the app a bit of a graphical interface. That said, I don't ever want to use it again.
Personally, I find Borland's products, such as C++ Builder and Delphi, to be good for doing quick GUI's. And you can code in a language that doesn't make you cringe.
I have done a lot of database work, and what I've not seen a Java tool do well yet is start from the SQL side of things - a really well written, fully optimized query, and then use that as a basis for mapping.
Instead almost every O/R layer under the sun assumes that I just want to store objects in the DB. Almost never in several years have I in fact wanted to do that, usually I wanted the results of a good query to be represented for me somehow. I think this can be done in Java (after writing three O/R mappers that come at the problem from this angle) but no commercial or free one seems to start from the right base yet.
"There is more worth loving than we have strength to love." - Brian Jay Stanley
The older you get, the harder it is to pick up new concepts.
Sorry, dude, but someone had to say it!
The older you get, the harder it is to pick up new concepts.
I've only found this to be true for those who "coast" and stop picking up new concepts in the first place.
KFG
Most of the examples in the EJB books thus far focus on e-commerce uses. Has anyone had any success using EJB for large scale scientific computing?
Perhaps you can tell me what the compelling need for Struts is, then. I've looked at it, and it doesn't seem to do anything that's worth the added complexity of learning and using it, not to mention adding one more external dependency to the project... Then there's the documentation issue, it seems to be nearly as impenetrable as the XSLT spec.
GCHQ Quantum Insert installed. If only our tongues were made of glass, how much more careful we would be when we speak
At least the novice developers can use it. Look at Visual Basic ... anyon[e] can pick it up and get started ... Now a large number of those first projects are garbage apps, but at least they give a starting point.
The idea of a novice picking up J2EE is fscking hilarious. J2EE is a framework for Enterprise applications. Almost by definition, these apps are outside the purview of a novice, at least without careful hand-holding by a guru.
Novices - using any language or environment - don't write applications with scalable components, a robust transactional system, a complex persistence mechanism, a high quality messge substrate, and a directory system.
One might as well complain that an F-15C air superiority fighter is inferior to a Cessna 172 because a beginner can fly a Cessna with very little training. If one needs to shoot down a Mig-29, the Cessna is not going to cut it. J2EE developers need to come to the environment after deveoping a sound foundation in other technologies, up to and including RMI and CORBA.
Java is the Cobol of the next millenium. You know, '00' and onwards. Millions and millions of lines of code barfed out for businesses. Nothing lovingly handcrafted to see here.
http://www.welton.it/davidw/
[1] Some (most?) vendors provide migration tools to transition from other containers.
[2] Some (JRun at least) can work with an EAR packaged for the reference implementation.
[3] If you are using an IDE, you will most likely need to fill out an additional properties tab for each bean, but how much work is that?
Well, I was speaking as opposed to the forced "innovations" from Redmond that require complete re-learning every 3-5 years or so. It is nice to get things right the first time, occasionally...
Pardon me if I wasn't clear.
(BTW, when we do "think outside the box" and come up with better new ideas, I suspect they'll also have plenty of staying power...)
Galileo: "The Earth revolves around the Sun!"
Score: -1 100% Flamebait
Tell us another joke, team lead.
People who push EJBs are not acting in the best interest of the company.
Managers are seduced by the hype, and their observation that "everybody else is doing it", so they order EJB to be used in the company.
Programmers are seduced by the buzzwords, and want to be able to put EJB on their resume, so they will either actively encourage their management to choose EJB, or will use it for every imaginable task if it has already been chosen.
In reality, over 95% of EJB applications could have been developed cheaper and faster and with less bugs if they used Java without EJB. You can get scalability, clustering, and failover with servlets, without the tedium of EJB. You can get persistence with JDO or JDBC facades, with better performance and simpler than entity beans. You can get asynchronous messaging by using JMS without EJB. You can get remoteness using RMI without EJB.
But the reality doesn't matter. Both programmers and managers have been seduced by the hype and buzzwords, so EJB will live on even if it makes things ten times more difficult and expensive.
---------
There is inferior bacteria on the interior of your posterior.
Yes, Java is "write once, run anywhere." The deployment descriptors are often portable provided that you do not use any of the server-specific extensions. Of course, this limits the value of investing in such servers as WebSphere and WebLogic whose value-add are those extensions. Keep in mind, however, that it is Java code that is promised to be portable, not configuration files.
In EJB 1.0, there was no portability to speak of, as the descriptors were compiled classes. EJB 1.1 introduced a standardized XML format which has helped.
The bottom line, of course, is that true portability of hand-coded deployment descriptors does not exist. Nonetheless, for anything but the most trivial of projects (such as those found in books), you really should be using a build tool for the deployment descriptors. There are many out there, some of them even free. XDoclet (http://sourceforge.net/projects/xdoclet/) is one such tool.
The end rule is: portability, like any other aspect of development, must be planned.
Ryosen
One man's "Troll, +1" is another man's "Insightful, +1".
A silly argument, really. The Perl/Python/Ruby compilers wrap the same logic around your print statement that Java requires you to enter on your own. While at first, this might seem like a great advantage, it limits the ways in which the code can be used.
Placing the hello world code in a main statement specifies a distinct context in which that code is to be used. It could just as easily be as simple as:
System.out.println("hello world");
Now, before you start clacking away at your keyboard, saying that all you have to use is the print keyword in [insert language here], you can do this with Java, too.
public void print(String s) {
System.out.println(s);
}
Then, invoke it as such:
print(s);
Easy! This is, of course, a very trivial example and should not be taken as a serious measure of any language's capability. The mere fact that someone has already created this method for you in your language of choice does not make that language superior.
If it did, then BASIC was the greatest language ever devised.
Ryosen
One man's "Troll, +1" is another man's "Insightful, +1".
Hmmm....perhaps, then, Java is not a language for beginners. Not all tools should be for the novice. While I have known many beginners who have done just fine with Java, if it presents a problem for you, find another language. Visual Basic perhaps.
Of course, one could also argue that folks would be a lot better off starting with Assembler, moving to C, and then to Java. Especially with Assembler, at least *then* they would have an understanding of what actually goes into an I/O instruction as trivial as "print". It's wonderful that your language of choice makes it so easy to do something such as "input a$", but when it doesn't work, do you even know why?
For those who are so inclined, Java allows you to get down and examine the compiled code instruction by instruction. Can your language? I'm not trying to suggest that Java is necessarily better, I'm just tired of amateurs like yourself insisting that it's a bad language. It's not. You don't like the fact that you are forced to adhere to the OO paradigm? Use a different language. You don't like the fact that Java compartmentalizes functionality into packages and gives you access to a deeper level of ability and interaction with the operating system? Use a different language. You don't like the fact that low-level system calls are sacrificed at the expense of portability, a feature that many of us *do* need? Use a different language.
I have no desire to start a flame war, here. But it is crucial to accept the fact that different languages exist for different purposes. Languages like VB are great for quickly getting a GUI-based app up and running. Perl and Python are fantasic for kicking out small CGI-based apps. But for building large-scale, scalable, distributed applications, I'll take Java and, where appropriate, EJB every time.
I've noticed that you have made several posts in this thread denoucing both EJB and Java as a whole. I have to wonder why you are so persistent in this battle when you are clearly not a Java developer. The book, Bitter EJB, is clearly for EJB/Java developers. The review was written for the book. This thread exists for the review. Thus, the thread is for EJB/Java developers. Why do you continue to participate in a discussion that you have freely admitted aren't in support of?
As for the language itself, it has become apparent to me, from reading back over your posts, that you either are not a professional programmer, or that you did not spend an adequate amount of time evaluating Java. Again, not every language is right for every person, just as not every tool is right for every job. Still, I'm at a loss as to why you are being so persistent in displaying your ignorance about Java, EJB, and distributed architecture in general.
Care to comment?
Ryosen
One man's "Troll, +1" is another man's "Insightful, +1".
You look at most Java job postings, and they say EJB experience is required. Of course, they also want VB, ASP, C#, COBOL, LISP, assembler, Ant, JUnit, and Oracle. Stuff that really goes together, I know.
Oh yeah, and they're asking for Java certs, too. Never knew certs to be of good use when I was on the other side of the interviewing table; usually the inexperienced folk had them.
So go bone up on EJB. You'll need it to get the interview. BTW, it's spelled E J B.
DT
Is this thing on? Hello?
Enterprise apps aren't a big deal. Most of them are so well defined and have been done so often that they are pretty much considered "cookie-cutter" applications.
For some real hard-core programming work, you should probably check out what is being done with ACE and TAO and CIAO. These applications are definitely way above the knowledge of a typical novice user. Mainly this is the case because they encompass everything from the highest levels (Model Driven Architecture) down to the lowest levels (embedded hard realtime systems, device drivers, assembly language) -- and everything in between (distributed/multi-platform, fault-tolerant development, etc). If a novice can do all that, basically, they are not a novice.
I totally agree that the Java envirionment is not as easy for Hello World as VB.
But, it there is a cost for device independence. A small cost I think, compared to say C++. Talk about needing to understand the world to get anything more than Hello World done in that envrionment.
The compromise of Strong Typing vs Pure OOPS I think was well done in Java. So you pay for that too.
I teach on the side and the hardest thing I find for the students is the requirement (not mine) to use C++. Java would make their lives much easier without sacrificing too much. Most will become Web developers or application programmers and not device driver or OS writers anyway.
True, Java has the possiblity to have the same crippling effect that any one language envirionment has on developer having the conceptual tools to re-form solutions in new and different ways. But then that has always been the provence of the top developers anyway. The rest are after productivity. And there Java has some nice feature for short term and long term, and resume building as well.
I am an advocate of the art of dumb programming. You can certainly clever your self into a corner or as we have seen with APL or Lotus 123 totally mis-use a Turing Complete language.
Then again good engineering is usually hidden from view and shows up with, "Thats easy, I could have done that" feelings, where the reality is much finer honed. Like the pitcher who knows exactly which pitch to pitch for a quick and effective result.
Can I buy you a Slashdot subscription, Subject Line Troll?