Alternative deployment
methods, Part 2: The best of both worlds -
JavaWorld July
2000
Tutorial Details:
Alternative deployment methods, Part 2: The best of both worlds
Alternative deployment methods, Part 2: The best of both worlds
By: By Todd Sundsted
Add a new trick to your Java application-deployment toolbox
n my previous column, I examined the most widely used method of deploying Java client-side applications in enterprise environments -- the applet -- and presented several reasons for its popularity: the ubiquity of browsers, ease of distribution and maintenance, and so on. I also described its limitations, which include lengthy download times, the browser's document-centric presentation model, and nonuniform support across browsers.
Despite these shortcomings, applets should not be abandoned completely. They are clearly useful in some situations - for example, as realtime information on an otherwise static Webpage. Problems arise, though, when developers use applets inappropriately. Unfortunately, too many training classes and books still put a disproportionate amount of emphasis on applets, and many newcomers look solely to applets when deploying Java applications in a Web-based enterprise environment.
Alternative deployment methods: Read the whole series!
Part 1 -- Beyond applets
Part 2 -- The best of both worlds
Part 3 -- The code
In Part 2 of this series on deployment methods, I present an alternative technique that uses applets in an unconventional manner. This method melds some of applets' best features with those of traditional deployment techniques and creates a foundation upon which powerful deployment tools can be built.
The time is ripe to adopt a new deployment model. In recent months, I've talked with developers who have independently created similar techniques. Vendors are also stepping up to the plate -- during JavaOne, a handful of companies announced products that fit the model I describe in this article. See Commercial deployment products for a discussion of off-the-shelf products.
Applets play a new role
The greatest boon to the applet deployment method is the ubiquity of the browser -- since browsers are everywhere, applets can run everywhere. Unfortunately, applets suffer from deficiencies in their original design (a simplistic lifecycle and the need for network connectivity), the browser's document-centric presentation model, and implementation differences between browsers (although Sun's Java Plug-In has helped quite a bit).
The method I describe here uses an applet as the delivery vehicle, thereby employing the browser's ubiquity, but avoids implementing an applet as the execution platform, thus skirting the problems described above.
Figure 1 illustrates the general design:
Figure 1. The relationship between repository, Web server, and browser
The system consists of three core components (the repository, Web server, and browser) and one optional component (the deployment server). The repository holds deployable resources, the deployment-instructions file, and a small boot-strap applet. The Web server delivers resources from the repository, in addition to typical Web fare like Webpages and images. The browser provides the user interface and the initial installation platform. I'll explain the function of the optional deployment server below.
How it works
You (the deployer) begin by packaging the application as one or more deployable resources. You then create a deployment-instructions file that defines the steps necessary to deploy the application, and you place everything in the repository. Finally, you create a Webpage containing instructions and the boot-strap applet, and either publish the Webpage or mail it to the users. (The latter option requires that the user have a Java-enabled mail client.)
The user accesses the Webpage from a browser, which fetches and starts the boot-strap applet. With a simple wizard-like interface, the applet leads the user through the installation setup. When setup is complete, the applet obtains the necessary filesystem permissions and begins to acquire and install the required resources; application code, application data, and the Java Runtime Environment if not already present. Once the user has installed the application and supporting components, the applet's work is done.
The user can return to the page later to check for updates, or the deployment engine, which can be embedded in the application itself, can automate updates.
Below, Figure 2 illustrates the functional composition of the boot-strap applet.
Figure 2. The all-in-one boot-strap applet
The applet is the centerpiece of the entire operation. It must include the logic necessary to direct the installation process as well as the machinery necessary to execute the installation process. You'll notice a potential problem when you start adding on the necessary components: the applet quickly grows so large that its own deployment becomes problematic.
Below, Figure 3 illustrates an alternative architecture.
Figure 3. The client/server approach
You can, in fact, separate the logic that directs the installation process from the code that executes the installation process on the user's machine. The logic and associated infrastructure that compose the bulk of the applet can run as a separate server. This server controls the applet's behavior via RMI or some similar technology. Thus, the applet can become much thinner at the expense of running another server process.
The deployment instructions
Whether you run the deployment machinery as an all-in-one applet or in the client/server configuration, you must define the steps required to deploy your application. Those steps compose the XML deployment-instructions file, which contains deployment instructions formatted as XML and patterned after rules used in tools like make . Each rule consists of a target, a variable amount of preconditions (which may well be zero), and a body containing executable steps. An engine in either the applet or the deployment server interprets the XML instructions and directs the execution code to carry out specific operations.
See Resources to download a format for conforming XML deployment-instructions documents and a simple deployment-instructions document.
The order of the deployment rules is insignificant. The engine builds an internal model of the information in the deployment-instructions document before directing the installation.
Security considerations
The boot-strap applet requires access to a user's filesystem to install deployment resources on said user's machine. Java wisely prevents this, since giving out untrusted code access to your filesystem is risky. Thus, applets are forced to remain "inside the sandbox."
Both of the major browsers (Netscape Navigator and Microsoft Internet Explorer) provide proprietary APIs that free applets from the sandbox. Also, Java 2 allows digitally signed code to perform specific restricted operations with the user's permission. Unfortunately, without the Java Plug-In, Java 2 is not yet supported by the major browsers. Since the plug-in is not an option on some platforms and in some environments, the applet must potentially support all three security models.
Coverage of these three security models would require an article apiece -- rather than explore this interesting but peripheral topic, I've provided numerous links (see Resources ) for those who wish to learn more.
Conclusion
The technique outlined above looks good in theory and works well in practice. I've included the code (see Resources ) so you can put the technique to work immediately. If you're interested in an introduction to the technique's inner workings, I suggest you return for Part 3, where I'll take you on a tour of the code and provide some examples to get you going.
This page formated for crawlers and browsers that don't support scripts and tables.
Home
EZone
Read
Tutorial at: Click here to view the tutorial
Rate Tutorial: Alternative deployment
methods, Part 2: The best of both worlds -
JavaWorld July
2000
View Tutorial: Alternative deployment
methods, Part 2: The best of both worlds -
JavaWorld July
2000
Related
Tutorials:
|
Displaying 1 - 50 of about 2323 Related Tutorials.
|
Struts Alternative
Struts Alternative
Struts Alternative... the alternative to the struts framework. Here we have listed the listed the frameworks that can be used as an alternative to the struts framework |
JDO UNPLUGGED - PART 1
UNPLUGGED - PART I
JDO UNPLUGGED - PART I.... CMP
supports both object database and relational database but CMP cannot be used...-in to vendors product etc.,
JDO introduces a new step in the deployment process |
Best Open Source Software
Best Open Source Software
Best Open Source Software
Best Open Source
Open source software. Often (and sometimes incorrectly..., and even fewer are aware that this alternative software development model exists. Most |
Wi-Fi as a part of LBS
Wi-Fi as a part of LBS
Wi-Fi as a part of LBS... define the function of Wi-Fi network, the best one is to take walkie-talkie... depending on the deployment of routers. So, it is one of the most important wireless |
Deployment
Java: Deployment
Java NotesDeployment
Applications
Installers
launch4j.sourceforge.net/ (Free... Not and How
Deployment: Easy Installing with IzPack
Applets |
JDO UNPLUGGED - PART II
UNPLUGGED - PART II
JDO UNPLUGGED - PART II... directory of hibernate(both 2 and 3) also... provides methods to construct a 'PersistenceManagerFactory'
instance from |
Methods - Vocabulary
entry should really be marked both
by area (methods, awt, ...), and by level...
Java: Methods - Vocabulary... other methods
can call this method.
keywordaccess
noneIf you |
Alternative Data Structures
Java: Alternative Data Structures... access" and
"methods to test or create typical set-theory properties... alternative to the Java Collections Framework
(JCF) when using primitive data |
Getting Methods Information of a class
Getting Methods Information of a class
Getting Methods Information of a class
 ...;
In this part of tutorial you |
VoIP Security
the security risks that can crop up when the voice and data worlds converge, users.... As with many new technologies, VOIP introduces both security risks and opportunities....
There's no magic bullet for effective VoIP security, but it must be part |
J2EE Interview Questions -2
;
Question: What is Deployment Descriptor?
Answer: A deployment... of .xml. Deployment descriptor describes the component deployment settings. Application servers reads the deployment descriptor to deploy the components contained |
Open Source Movement
as an alternative label for free software, primarily on pragmatic rather than... of it) while still at UC Berkeley around 2000. I did some work (actually my students..., it is a world-wide movement composed, both formally and informally, of many |
Open Source Movement
as an alternative label for free software, primarily on pragmatic rather than... of it) while still at UC Berkeley around 2000. I did some work (actually my students..., it is a world-wide movement composed, both formally and informally, of many |
Declare tag methods in jsp
and methods in scriptlet
part but the scope of these members will be only in same...
Declare tag methods in jsp
Declare tag methods in jsp... that
allows to keep separate the dynamic part of your pages from the static HTML |
JAVA JAZZ UP - Free online Java magazine
Around the Globe
Sun released Java SE 6 Update 2 on 16 July 2007..., intelligent project management, build and deployment tool provided by Apache?s...
Pattern
All the creational design patterns define the best possible way |
When you look back on the position you held last, do you think you have done your best in it?
your best in it?
When you look back on the position you held last, do you think you have done your best...;
If you say that you did, it could mean that your best is already behind |
Open Source Databases
as a preliminary Perl implementation, this is the best iteration of OSDB yet... Systems. I do not aim to find the 'best' one, or perform an in-depth feature... McKendrick. Programmers often select a single database for both application development |
Crystal Reports for Eclipse
-in that
provides a 100 percent Java-based report design and deployment environment... Objects. There has been a huge response from both the media and Java developers... to access this same logic
Deployment Assistance - Never have to worry about |
RIAs Methods And Techniques
Applications Flash,Rich Internet Applications With Adobe Flex And java,RIAs Methods And Techniques
RIAs Methods And Techniques... user interface markup language can be used in RIAs as an alternative
to HTML |
oXygen XML Editor
in both the corporate and academic worlds. It provides the
necessary tools |
Class, Object and Methods
Class
Class, Object and Methods... etc.
In this Program you will see how to use the class,
object and it's methods... and related methods of the special class. In the above
example the sq is the object |
Creating Class in JRuby
;
In this part of JRuby tutorial you will come to know
that how one can define a class in JRuby and can define methods in class... class "Employee"
and also defines two methods "information" |
Open Source Metaverses
connections, however, the opportunity arose to create immersive alternative worlds... Second Life, There and Active Worlds.
The OpenSource Metaverse Project... worlds that allow customization by the player and creation of one's own worlds |
Deployment in Tomcat 6.0
Deployment in Tomcat 6.0
Deployment in Tomcat 6.0
  |
Example -- drawHouse
methods that call other
methods of ours. This JPanel can be used as a component... have a method that does only part
of the problem, but not all of it. How can we write this?
Solution: We can use methods that we wrote earlier
so that we |
Method Overriding in JRuby
;
In this part of JRuby tutorial you will know to
implement overriding of methods between the classes. In earlier examples of
JRuby you have studied a lot about to create class, inheriting class and calling
methods |
The Best We Offer
The Best We Offer
The Best We Offer
Keeping the existing trend and future |
Methods - OOP
Java: Methods - OOP
Java NotesMethods - OOP
Static methods
If your method doesn't... utility methods
and main(...), you should probably not be using static |
Open Source Web Frameworks in Java
. Struts is maintained as a part of Apache Jakarta
project and is open source... of objects, methods and properties instead of URLs and query parameters. Tapestry is an alternative to scripting environments such as JavaServer Pages or Velocity |
Java Data Structures
for Java's data structure facilities is Collections,
a term is is an alternative... and java.util.Collections
is the name of a class containing many data structure utility methods...,
or write their own sort methods.
This is completely false! Many standard data |
WEBSERVICE USING APACHE AXIS - TUTORIAL-2 AXIS FOR EJB-WEBSERVICE (part-5)
using Axis. This is a 7 part
article.?
part-1 : Overview
part-2 : deploying ejb in weblogic-7
part-3 : Drop-in-deployment in Axis
part-4... approach is preferable because, the best method is to use
a stateless-session bean |
Java Virtual Machine(JVM)
running JVMs
Available for both Microsoft Windows 2000 and Red Hat Linux... of Java architecture and it is the part of the JRE (Java Runtime Enviroment... to run. JVM is a part of Java Run Time Environment that is required by every |
Static/Class methods
Java: Static/Class methods
Java NotesStatic/Class methods
There are two types of methods.
Instance methods are associated with an object and
use the instance variables |
Programming: Initials 2
________________________________________
Overview. Write a program that asks for a name, including both first... of this exercise is to use
the if statement as well as more Java String methods...
extra can cancel out points you may lose in the main part of the problem |
Events
to handle events in
Java awt. Events are the integral part of the java platform. You... methods through which you can implement the event driven application.
For any... need to implement multiple methods like key Events.
There are three methods |
Open Source Dreamweaver
alter them.
The best part is that you can update the design of the template... the design and content independently. The best tool I've seen for this is Macromedia's... this template.
For a Linux desktop solution, the popular alternative seems |
Common Component Methods
Common Component Methods,Common Component Methods Using Java Awt
Common Component Methods
 ... methods of AWT components are as follow:
1 getLocation() - This method is used |
Open Source Jobs
of Linux / Open Source professionals, providing both contract and direct hire..., because the best arguments for open-source are grounded in economics... customers need, is why this plant is in Sunnyvale. "We?re doing rapid deployment," he |
Methods - Introduction
Java: Methods - Introduction... will use method.
Why use methods?
For reusable code... a method
for solving your big problem by calling on other methods |
Summary: Methods
Java Summary: Methods
Java: Summary: Methods
Parameters
Method parameters are separated by commas.
Parameters are converted to these larger or equal types (int, long, double |
Summary - Character
: Summary - Character
Character class static methods
Character Class Methods
Character class is used mostly for static methods to test char values.
b ... of course.
Below is a table which shows this common first part of the Unicode character |
Methods - Calling
Java: Methods - Calling
Java Notes
Methods - Calling....
When you call methods which are defined in your own class, you don't need |
Nexenta OS Alpha 3 has been released
, and in particular: OpenOffice.org 2.0 (distributed with both InstallCD and LiveCD... on the best existing software: SunOS kernel and GNU software. We use Debian - one of the best existing software distribution/packaging mechanisms - to glue |
Methods - Declaring
Java: Methods - Declaring...()
and paintComponent() methods to be public so that the
browser and Java GUI code... it.
static
The static keyword is used to declare class methods -- methods |
Java Methods
Java Methods
Java Methods... in the
program to invoke the
methods. As you can see here we are using reflect method, this could be
either a class method or instance method and the usage of methods |
Methods of Servlets
Methods of Servlets
Methods of Servlets...;
A Generic servlet contains the following five methods:
init()
public void init... calls
the destroy() method, no service methods
will be then called . That is after |
JSP methods
JSP methods
JSP methods
 ... for declaration the variables and methods. In
the method we are adding to numbers |
Abstract methods and classes
Abstract class,Abstract methods and classes
Abstract methods and classes
 ... language the word abstract is used
with methods and classes.
Abstract Method |
Methods - Example
Java: Methods - Example
Java NotesMethods - Example
Example
This example shows a simple method that computes the area of
a rectangle:
1. public static int |
Linux Vs. Windows
;
Both Linux and Windows works as an operating system. Both are highly popular
and are in the great demand. The working performance of both the operating... as desktop operating system. Here we are comparing both the operating system |
|
|
|