Here is code, as opposed to "pretty pictures" -- LOL  ;-)

This is intended to demonstrate how simple Had is in contrast to
normal Service Locator or Inversion of Control (Dependency Injection)
frameworks.  Remember, THIS IS ALL THE CODE.  There are no
NanoContainers.  Not XML.  No Config classes, etc.  Where you want to
have a single class with potential changes in implementations, you
simply do not change the name of the class, e.g. provide new
implementations under the same name.  Where you want implementations
that are different, e.g. if the Action class were an interface, you
simply use different names for the different implementations and then
you can hot deploy variations on the code in classes with those names.
 This allows you to change an existing implementation radically either
by hot deploy or by name.  Which you want to do depends on the
situation.  ActionServlet would want to be, for example, an interface
that allowed differing implementations under "ActionServlet" without
having different named implemenations, like you have with IoC and
Service Locator solutions.  On the other hand, you also would get hot
deploy of various Action implementations under different names, e.g.
LogonAction, PublishAction, etc.

A working application with the App interface and client tester is
available in a zip file, classes.zip, at


http://131.191.32.112:8080/classes.zip


This code has some additions that allow us to see whether or not a
particular object has the last loaded implementation of AppImpl.  The
code includes:

App.java
AppImpl.java
AppHotFactory.java
TestAppClientTester.java
SiteConstant.java
Classpath.java.java

To use a new AppImpl, all you have to do is to drop the AppImpl.class
into the classes/deploy/com/crackwillow/app directory and call
AppHotFactory.loadAppImpl().

To see the "name" command work with the client, start the client with
java com.crackwillow.testing.TestAppClientTester NEW_NAME


Jack





-- 


"You can't wake a person who is pretending to be asleep."

~Native Proverb~

"Each man is good in His sight. It is not necessary for eagles to be crows."

~Hunkesni (Sitting Bull), Hunkpapa Sioux~

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to