[H-GEN] Samba-appletalk-Mac & enhydra
Bradley Marshall
bradm at uq.net.au
Wed Jan 31 20:56:18 EST 2001
[ Humbug *General* list - semi-serious discussions about Humbug and ]
[ Unix-related topics. Please observe the list's charter. ]
[ Worthwhile understanding: http://www.humbug.org.au/netiquette.html ]
On Thu, 1 Feb 2001, bmatthewtaylor at yahoo.co.uk wrote:
> Was also planning on having a play with Enhydra, have been putting that off
> for a while now, anyone here actually used it?? I know of at least a couple
> of people who are developing with Zope, curious to hear a few opinions to
> compare Zope/Enhydra/PHP/Perl/Python/Servlets etc.
Plugged In uses Enhydra a fair bit, I've gotten some comments
from one of the developers here.
-- Begin comments --
From: Ben Warren <ben.warren at pisoftware.com>
Subject: Enhydra
here are some points I have noted in my use of enhydra.
A simple description of an enhydra app is that it is a single Servlet
that farms out requests to classes based on the URL it receives. It
provides session management, database connectivity etc.
For me the real strength and sometimes weakness of Enhydra is its use of
XMLC (XML Compiler) which allows the code to be seperated (not embedded
with special tags) from the HTML page.
Using enhydra, all pages are generated by manipulating the Java DOM
(Document Object Model). The DOM is initially constructed by XMLC which
makes a Java class that represents a static HTML page. The static page
is pure HTML and can be devloped by a web artist with no knowledge of
Java and usually contains the prototype tables, rows, text, images etc
that you want to manipulate. All the developer has to do is put "ID"
attributes in the tags of the page elements they are interested in and
XMLC will produce accessor methods to get these nodes directly out of
the DOM.
Here is a small example:
<HTML.....
<SPAN ID="SomeText">A string of text.</SPAN>
<IMG ID="AnImage" SRC="fred.png">
..../HTML>
To set the text and change the image you could do this.
public class ExamplePage implements HttpPresentation {
public void run(HttpPresentationComms comms ) throws
HttpPresentationException {
//Class generated by XMLC - represents the HTML in Java.
ExampleHTML page = new ExampleHTMLImpl();
//Change the text.
page.setTextSomeText("Another String of text.");
//Change the image.
HTMLImageElement image = page.getElementAnImage();
image.setSrc("barney.png");
//Write the page out.
comms.response.writeHTML(page.toDocument());
}
}
The HTML can be changed around during updates to the look and feel of
the sight so as long as the tags with the ID attributes are still
present. All that is required to update the Java code is to run 'make'
which runs XMLC and recompiles the DOM class for the HTML page.
Other nice features of Enhydra are:
# It uses Servlets and therefore Java which has a huge range of well
documented standard libraries to use and makes custom database
connectivty easy with the JDBC classes.
# 'Multiserver' which is a mini webserver that can be used to run the
apps both while developing and in production.
# The apps can be run on any servlet capable web-server. (Apache-Tomcat
for example)
# Enhydra apps are contained in a single jar file which makes
transporting them very easy.
# It has its own Makefile system for easy building of the code source.
Basically you are not limited at all by Enhydra, however for small
non-complex apps enhydra is probably a bit of an over-kill.
Cheers,
Ben
-- end comments --
+=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-+
| Bradley Marshall | http://www.uq.net.au/~zzbramar |
| System/Network Admin| brad at humbug.org.au |
| Plugged In Software | bmarshal at plugged.net.au |
+-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=+
``I'm not ashamed. Its the computer age. Nerds are in.'' - Willow (BtVS)
--
* This is list (humbug) general handled by majordomo at lists.humbug.org.au .
* Postings to this list are only accepted from subscribed addresses of
* lists 'general' or 'general-post'.
More information about the General
mailing list