Business logic layer - what to use?

Chong Yu Meng chongym
Mon May 17 11:58:54 PDT 2004


Collins Richey wrote:

>On Fri, 30 Jan 2004 14:55:13 -0500
>Matthew Carpenter <matt at eisgr.com> wrote:
>
>
>  
>
>>Also, remember that Linux 2.6 is supposed to include a new threading 
>>model which will make Java run better on it.  
>>    
>>
>
>According to everything I've read this is is still bleeding edge and no where ready for public consumption.  As to whether it's kernel code or glibc code, the new threading model doesn't work with a lot of applications.  A lot of traffic on gentoo (Q. "My xxxxxx won't work" A. "Get rid of the new threading code.")
>
>  
>
Actually, the pre-1.4 JVMs could not even run on NPTL Linuxes. If you're 
using 1.3.x or earlier, you'd need to disable "floating stacks" (export 
LD_ASSUME_KERNEL=2.2.5), which theoretically means that Java does not 
make use of the full benefits of NPTL, if at all. With v 1.4, you don't 
need to disable "floating stacks", and theoretically, you do gain the 
benefits.

I say "theoretically" because it really depends on what you mean by 
"fast". When I run the same application on Java and on Windows, I see a 
significant speed difference. I used to do that quite a bit on my 
machine at work which was a dual boot Linux/Windows tricked-out Celeron. 
It could be the JVM (IBM Java 1.3.x) being different for Windows and 
Linux, but I think a more plausible explanation is the way the OS 
handles and manages resources.

Another thing about Java is this : don't believe the hype! There are 
some myths about Java that just give it a bad name. For example, some 
people say that memory management is better in Java because you don't 
need to understand and use pointers. Well, that gives a lot of people 
the wrong impression that memory management is better. If you create a 
lot of objects and don't bother to dispose of them (no, you cannot trust 
the garbage collector), you will encounter memory problems worse than 
Visual Basic -- in fact, your program may not even run.

I use Java not because of its cross-platform nature, or because it is 
"fast", but because I like the programming model, and the tools are free 
! That's right -- free. I use Tomcat, Eclipse and a host of free tools. 
This means that the development cost to my employer is just my time, not 
software. And because I use Linux, I save on hardware, and I have no 
need for daily backups (because I'm afraid Windows will crash).

Java is NOT easy, and the free tools are not easy to learn, install, or 
configure. Ask any new Tomcat administrator, and they will tell you that 
it is a complex and temperamental beast. I don't recommend Tomcat unless 
you have no money, or you have a knowledgeable friend who is willing to 
walk you through the hellish configuration.

What Java is good for is educating the programmer: how to create and 
dispose of objects, how to design re-usable code, etc. If implemented 
well, Java can be very scalable, and flexible. Unfortunately, the time 
it takes to go from novice to competent is long and it requires a lot of 
effort. If I could show you the emails I get from India asking -- no, 
demanding -- help because of Java or Tomcat problems, you'd get a 
picture of just how difficult it is. I would say that it is the 
difference between street religion and divinity school.

Regards,
pascal chong





More information about the Linux-users mailing list