Java / EJB


Java on Linux

Want to run Java on Linux? I suggest the IBM JDK 1.3 for Linux; I’ve been working with it (on this server, in fact) with good results.

Java Web Applications

In the world of Java web application program, the "default" answer of to the question of how to connect the Java to the HTML is JSP. For a number of reasons, though, this is often not a very good answer. Jason Hunter at servlets.com wrote an article "The Problems with JSP" about this which caused quite a lot of discussion about this a while back.

Another article in the same is "JavaServer Pages: Panacea or Quagmire".

In my experience, JSPs tend to lead a project down the path of mixing enough Java syntax in to HTML that the HTML can no longer be edited by non-developer. It really does not take very much Java to make that happen, especially since the compilation errors that can erupt from malforms JSP files can be hard even for a Java developer to track down. For small projects this need (for a Java developer to edit HTML files) may be acceptable, but for large projects it can stomp on your attempts at division of labor and greatly increase costs, as each cosmetic change now involves coordinating the efforts of a web designed and Java developer. Ouch.

Speaking of web applications, not everything is cut out be to a web application – and not everything should be in Java. If you are interested in using native Windows clients with Java server code, take a look at LINKTITLE[103].

Misc. Links

Gopalan Suresh Raj’s web site has comparive code snippets covering COM DCOM JAVA/EJB CORBA .NET etc. There are a lot of developers who think of these technologies as very different; Gopalan’s site points out many similarities.

Jive looks to be high quality, Java servlet based discussion forum software. I’ll replace this comment with a report from the "real world" once I have it running.

EJB Related Links

A good starting point for EJB information is at http://patriot.net/~tvalesky/ejb.html

Also take a look at the EjbRoadmap.

theserverside.com and ejbinfo.com are SlashDot-like discussion sites; they don’t seem to get a great amount of discussion but often do have excellent articles.

A lot can go wrong in J2EE projects; this article has a "top ten" list of failulre modes, many of which really aren’t J2EE-specific at all.

JBoss is an open source, standards-focussed EJB container. Many team benefit from using JBoss for development even if they plan to use something else for deployment. Developing with JBoss in addition to another environment tends to "keep you honest" about following the EJB specs, reducing the likelihood of inadvertantly adding vendor-specific code.

Grid Components for Delphi

This list of Grid components available for Delphi. is originally from a Usenet post by Anthony Richardson (anthony_r at sageautomation.com). I’ve added more since then.

The following is a list of Third-Party Grid suppliers:

SpreadSheets:

TAdvSpreadGrid – http://www.tmssoftware.com/
TSpread – http://www.jt.w1.com/products.htm
TSpreadSheet – http://www.uniyar.ac.ru/~dimak/delphi/spread.shtml
THyperSpreadsheet – http://www.pablop.demon.co.uk/

Non-DataAware:

InfoPower – http://www.woll2woll.com/infopower/
Top Grid – http://www.objectsight.com/
TAdvStringGrid – http://www.tmssoftware.com/
TStringAlignGrid – http://www.hoerstemeier.com/
(Free)
TSMTableGrid – http://www.sunsoft.ru/
THyperGrid – http://www.pablop.demon.co.uk/
TCoolStringGrid – http://www.cooldev.com

Data Aware:

TDBAdvStringGrid – http://www.tmssoftware.com/
QuantumGrid – http://www.devexpress.com/
InfoPower – http://www.woll2woll.com/infopower/
TOPAZ – http://www.softsci.com/topazd.htm
Top Grid – http://www.objectsight.com/
DbAltGrid – http://www.dbaltgrid.com/
TIB_Grid – http://www.ibobjects.com/
TDBGridPro – http://vipper.downloadit.gr/
TSMDBTableGrid – http://www.sunsoft.ru/
X-DBGrid – http://republika.pl/kszyszka/x-files.html
TExDBGrid – http://www.gjl-software.co.uk/
TVizDbGrid – http://www.vizacc.com/i_prod_gexpert.php

Grid Print Engines:

PrintDAT – http://www.grebarsys.com/
ExpressPrinting System – http://www.devexpress.com/
My (Kyle’s) own grid print engine, developed just before these started coming out.

Header Footer Add-ons:

DbHdrCtrlGrid – http://www.dbaltgrid.com/
TSDBGridFooter – http://www.sedlan.com

Specialist Grids:

TIB_Ledger – http://www.ibobjects.com/

Delphi Resources

Pure Technologies offer open-source PureSOAP, which looks like a good way to use SOAP from Delphi, without require the Enterprise edition of Delphi 6. Another good approach for this is to use Microsoft’s SOAP support (ROPE, etc.) via COM.

DUnit is a Delphi version of the “xUnit” familt of unit test tools popularized by Extreme Programming adherents. I’ve found it quite useful even on projects that have nothing to do with XP. I tend to be skeptical of any significant body of code for which there is not a test suite.

Around the same time you automate your testing with DUnit, take a look at FinalBuilder for automating your build process in Delphi and other Windows IDE-based tools like help systems, installation systems, etc. I haven’t tried it myself yet it looks quite appealing.

Since the Kylix annoucement and arrival, there seems to be an abudance of people eager to use Delphi with non-Microsoft technolgoies, and I am pleased to see Delphi expand into the Linux world. We shouldn’t forget, though, that Delphi is superb for developing software using Microsoft technologies. For example, I have heard of companies doing all of their “heavy lifting” in COM objects written in Delphi, while using VB or ASP to put together overall applications. For more on Delphi with Microsoft technologies, see MSDelphi.com.

Windows Clients, Java Servers

Problem / Scenario:

You have server code in Java implementing business logic, or you want to have such code. Java is your strategic choice.

But… you have a need for a client application that will be a native Windows application, for whatever reason. Sample reasons: (1) they need to run quickly and smoothly on a factory floor full of Pentium 150 or slower machines with limited RAM. (2) they need to work in disconnected mode, or talk to local hardware, so a web application won’t work.

How do you write server code in Java (in EJBs, for example) but access it easily from a native Windows clients, for example a Delphi application?

Possible Solutions:

Solution #1: Talk JRMP from Delphi

Implement the Java RMI JRMP protocol in Delphi. This will be nearly impossible, since it is built on Java object serialization. So there are various approaches you could take.

Solution #2: Java on the Client, use JNI

Run Java on the client as well, and use JNI to communicate between Delphi and Java, then Java to do the client side RMI. This defeated the goal of keeping the client lean, though… a Delphi thin client can run well on an old, slow machine with 32 meg of RAM, Java can’t.

Solution #3: RMI-IIOP / CORBA

Some Java application servers can seamlessly (?) expose Java services (like EJBs) as CORBA objects. Borland has CORBA support available for Delphi. This will avoid the overhead of Java on the client, but is too vendor-specific for my tastes.

Solution #4: Your own Proxy on the server

Use a non-RMI way to communicate between the Delphi client and an extra “tier” at the server; this piece of middleware would communicate with Delphi using any of a number of methods, including DCOM. Then use JNI or other means to access the Java services on the same (server) machine.

Solution #5: ASTA-Java

ASTA has a product (though I don’t know if it’s in development, or ready to go) that provide an generic mechanism for invoking EJB operations, from a Delphi client. The challenge here is how to send and receive complex types, which are defined by Java classes.

Solution #6: Web Services with SOAP

Expose the server-side services as web services via SOAP. Choose an application server which will automatically expose your EJBs this way, if possible. Then use any available way to make a Delphi client talk SOAP. PureSOAP and Microsoft’s SOAP support are two possible ways. (This is really the most appealing choice to me, as of 2001.)

Solution #7: Homegrown web services

It’s really not all that hard to write wrapper code that exposes your server services via HTTP requests with parameters, via XML strings, etc. Such a thing would not be language specific, so the server could be on one language, the client in another. This solution has some appeal in cases where you want the pieces to be tightly “wrapped up” and not exposes in anything as standard as SOAP for some reason.

 

There many, many paths to use to get from point A to point B… if you have a different scenariou in mind, tell me about it and I will try to expand this page to cover it.

Need to do this for your own project? Consulting services are available.