<rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:trackback="http://madskills.com/public/xml/rss/module/trackback/" xmlns:wfw="http://wellformedweb.org/CommentAPI/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/"><channel><title>framework</title><link>http://blog.vckbase.com/bastet/category/621.html</link><description>framework</description><managingEditor>Diviner</managingEditor><dc:language>zh-CHS</dc:language><generator>.Text Version 0.958.2004.214</generator><item><dc:creator>Diviner</dc:creator><title>wxwidgets和其他GUI类库比较</title><link>http://blog.vckbase.com/bastet/archive/2005/06/09/6274.html</link><pubDate>Thu, 09 Jun 2005 02:17:00 GMT</pubDate><guid>http://blog.vckbase.com/bastet/archive/2005/06/09/6274.html</guid><wfw:comment>http://blog.vckbase.com/bastet/comments/6274.html</wfw:comment><comments>http://blog.vckbase.com/bastet/archive/2005/06/09/6274.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://blog.vckbase.com/bastet/comments/commentRss/6274.html</wfw:commentRss><trackback:ping>http://blog.vckbase.com/bastet/services/trackbacks/6274.html</trackback:ping><description>&lt;DIV class=wikiheader&gt;
&lt;H1&gt;&lt;A href="http://wiki.wxwidgets.org/wiki.pl?WxWiki"&gt;&lt;IMG alt=[Home] src="http://wiki.wxwidgets.org/wximages/wxwidgets02-small.png" align=right border=0&gt;&lt;/A&gt;&lt;A href="http://wiki.wxwidgets.org/wiki.pl?back=WxWidgets+Compared+To+Other+Toolkits"&gt;WxWidgets Compared To Other Toolkits&lt;/A&gt;&lt;/H1&gt;&lt;A class=wikipagelink href="http://wiki.wxwidgets.org/wiki.pl?WxWiki"&gt;WxWiki&lt;/A&gt; | &lt;A class=wikipagelink href="http://wiki.wxwidgets.org/wiki.pl?RecentChanges"&gt;RecentChanges&lt;/A&gt; | &lt;A href="http://wiki.wxwidgets.org/wiki.pl?action=editprefs"&gt;Log in/Preferences&lt;/A&gt;&lt;BR&gt;
&lt;HR class=wikilineheader&gt;
&lt;/DIV&gt;
&lt;DIV class=wikitext&gt;
&lt;H1&gt;wxWidgets compared to other toolkits&lt;/H1&gt;
&lt;P&gt;Some general notes: 
&lt;UL&gt;
&lt;LI&gt;wxWidgets not only works for C++, but also has bindings for python, perl, java, lua, eiffel, C# (.NET), basic, ruby and even javascript (see &lt;A href="http://www.wxwidgets.org/develop2.htm"&gt;[Related projects]&lt;/A&gt;). 
&lt;LI&gt;it is one of the most complete GUI toolkits. There are many utility classes. 
&lt;LI&gt;it is still heavily developed 
&lt;LI&gt;there is a lot of documentation (though a bit fragmented in places) 
&lt;LI&gt;free for personal and commercial use 
&lt;LI&gt;whenever possible, wxWidgets uses the platform SDK. This means that a program compiled on Windows will have the look and feel of a Windows program, and when compiled on a Linux machine, it wil get the look and feel of a Linux program. &lt;/LI&gt;&lt;/UL&gt;
&lt;P&gt;There is also a &lt;A href="http://developers.slashdot.org/article.pl?sid=03/01/21/2036250&amp;amp;tid=156"&gt;[slashdot thread]&lt;/A&gt; about cross-platform gui toolkits. Though it's old and, well, it's slashdot :), there are probably some useful insights there. 
&lt;P&gt;
&lt;H2&gt;wxWidgets compared to Qt&lt;/H2&gt;
&lt;UL&gt;
&lt;LI&gt;Both Qt (&lt;A href="http://www.trolltech.com/"&gt;http://www.trolltech.com/&lt;/A&gt;) and wxWidgets have many non-GUI-related classes, such as date/time, containers, networking and OpenGL functionality. However, if you are developing commercial applications (non-gpl) in Qt and want to use most of these classes (including the OpenGL widget), you have to pay extra for the "enterprise edition" &lt;I&gt;(&lt;A href="http://www.trolltech.com/products/qt/editions.html"&gt;http://www.trolltech.com/products/qt/editions.html&lt;/A&gt;)&lt;/I&gt; on top of the normal commercial version of Qt (the "professional edition"). 
&lt;LI&gt;Qt2 is available under the GPL for open-source applications, and under the QPL for commercial applications. Qt3 for Mac and GNU/Linux is similarly dual-licensed, but there is no free version of Qt3 for Windows. All ports of wxWidgets are distributed under a permissive modified (but explicitly OSI-approved) LGPL. 
&lt;UL&gt;
&lt;LI&gt;Trolltech has announced that Qt4 will be available under the GPL on Windows. See &lt;A href="http://www.trolltech.com/newsroom/announcements/00000192.html"&gt;http://www.trolltech.com/newsroom/announcements/00000192.html&lt;/A&gt;. &lt;/LI&gt;&lt;/UL&gt;
&lt;LI&gt;Qt doesn't have true native ports such as wxWidgets (&lt;A href="http://doc.trolltech.com/3.3/qtmac-as-native.html"&gt;[with the exception of Qt/Mac]&lt;/A&gt;.) Qt draws its own widgets on each platform instead of using the native widgets, whereas wxWidgets offers true native ports for all the supported platforms. Additionally, an approach similar to Qt's is achieved with wxUniversal (of course it should be noted that on some platforms, Qt _is_ the native GUI library.) 
&lt;LI&gt;Qt programs are not true C++ programs and require a special pre-compiler, the so-called Meta Object Compiler or moc. wxWidgets programs do not require this kind of preprocessing and are true C++ programs. 
&lt;LI&gt;Qt is used by several large projects like KDE and the Opera browser (on the other hand, wxWidgets is used by projects like the AOL Communicator) 
&lt;LI&gt;Qt makes extremely liberal use of virtual functions (QTWidget, the base class of all widgets in Qt had 91 at last count), giving it a more OO design than wxWidgets (which uses a more MFC-like approach using macros). What this means is fewer lines of code in general when using Qt, but faster execution speed when using wxWidgets (although the degree to which this occurs depends on whom you ask). 
&lt;LI&gt;Qt is used by IBM and Borland Kylix: this should yield more reliability. However, it is rumoured that wxWidgets will be used in the next version of C++BuilderX. 
&lt;LI&gt;Qt has a full-featured (commercial and royalty dependent) embeddable GUI (Qt/Embedded) based on GNU/Linux with framebuffer, it gives you a very fast time to market. This means that once you have Linux with /dev/fb you are ready to run examples in minutes, with no additional pains. Qt/Embedded has a small footprint compared with X11. 
&lt;LI&gt;There is an IDE for Qt, Qt Designer (though there are also several &lt;A class=wikipagelink href="http://wiki.wxwidgets.org/wiki.pl?IDEs"&gt;IDEs&lt;/A&gt; for wxWidgets). 
&lt;LI&gt;Qt offers reliable commercial support. 
&lt;LI&gt;There is nothing to stop somebody writing a Qt-based implementation of wxWidgets. &lt;/LI&gt;&lt;/UL&gt;
&lt;P&gt;
&lt;H2&gt;wxWidgets compared to FLTK&lt;/H2&gt;
&lt;P&gt;
&lt;UL&gt;
&lt;LI&gt;FLTK website: &lt;A href="http://www.fltk.org/"&gt;http://www.fltk.org/&lt;/A&gt; 
&lt;LI&gt;wxWidgets has a more mature OO design. 
&lt;LI&gt;FLTK is more light-weight, whereas wxWidgets is more full-featured (wxWidgets supports networking, printing, etc. while FLTK has limited or no support for these things). See xwWidgets Feature List (&lt;A href="http://wxwidgets.org/whychoos.htm"&gt;http://wxwidgets.org/whychoos.htm&lt;/A&gt;) vs. FLTK Feature List (&lt;A href="http://www.fltk.org/documentation.php/doc-1.1/intro.html#2_2"&gt;http://www.fltk.org/documentation.php/doc-1.1/intro.html#2_2&lt;/A&gt;). 
&lt;LI&gt;FLTK actually has more elaborate, different widget types. Just compare what you can do in FLUID to wxDesigner or DialogEdit. I ported a FLTK app to wxWidgets and had a hard time emulating the buttons. The window class we used gave screen flicker, etc. as the app grew in size, which was the motivation to transform it to wxWidgets. 
&lt;LI&gt;FLTK's modified LGPL license is more restricting than wxWidgets license, although it does provide exceptions for static linking. &lt;/LI&gt;&lt;/UL&gt;
&lt;P&gt;
&lt;H2&gt;wxWidgets compared to FOX&lt;/H2&gt;
&lt;P&gt;
&lt;UL&gt;
&lt;LI&gt;FOX website: &lt;A href="http://www.fox-toolkit.org/"&gt;http://www.fox-toolkit.org/&lt;/A&gt; 
&lt;LI&gt;FOX is more light-weight, whereas wxWidgets is more full-featured. 
&lt;LI&gt;wxWidgets has a more complete API, while FOX focuses mainly on GUI features. 
&lt;LI&gt;FOX draws its own widgets on each platform, instead of using the native widgets (like Qt), whereas wxWidgets offers true native ports for all the supported platforms. FOX may be faster because of this, but the provided look-and-feel may not be well integrated into the target platform (e.g. the Windows XP theme is not currently available). 
&lt;LI&gt;FOX lacks printing and I18N support. 
&lt;LI&gt;Standard Windows dialog boxes are not supported in FOX, but a portable similar feature is available. &lt;/LI&gt;&lt;/UL&gt;
&lt;P&gt;
&lt;H2&gt;wxWidgets compared to Java&lt;/H2&gt;
&lt;P&gt;
&lt;UL&gt;
&lt;LI&gt;Java is a platform while wxWidgets is a GUI API (and can be used with python, perl, C++, java, lua, eiffel, C# , basic, ruby, etc.) so a comparision of the two may not be completely balanced. 
&lt;LI&gt;Java programs are compiled from bytecode at runtime. This means when a user first starts your program, it will take longer to load and the first few moments using the program will be sluggish. (Java compilers such as GJC are avalible, but do not support all Java features well/at all). 
&lt;LI&gt;On the other hand, wxWidgets is compiled directly to machine code and gains all the speed advantages that go along with that. 
&lt;LI&gt;Java bytecode can be decompiled. This is not a problem if your application is open source. However, if having users seeing your source code is a problem, then you may wish to consider other options. 
&lt;LI&gt;Users of Java based applications must have a JVM installed. In recent years, this has become less of an issue as more computers are being installed with Sun's JVM. However, user's that have an older JVM may suffer from performance/security problems. 
&lt;LI&gt;Due to the fact that Java's libraries are slow, some Java libraries are being written in C++ using wxWidgets! 
&lt;LI&gt;An example of the above is wx4j, a wxWidgets implementation for Java. wx4j is a wxWidgets binding for Java which allows Java programmers to keep their Java language but still have the speed of a C++ written program. 
&lt;LI&gt;In order to be cross-platform, Java generally targets the least common denominator. Features that are only available or relevant on one platform but not others are left out of the Java APIs. Examples include manipulating the Windows taskbar, the Mac OS menu bar, Unix file attributes, etc. 
&lt;LI&gt;A corollary of the statement above: in a wxWidgets program, you can always write some platform-specific code where necessary, inside of an ifdef that makes it only compile on that one platform. In Java, there's no equivalent of an ifdef, and you have to jump through hoops to access external APIs. Also, wxWidgets emulates certain features that are not avalible on different platforms (such as MDI and tree controls). 
&lt;LI&gt;Java programs invariably consume more memory than equivalent C++ programs. 
&lt;LI&gt;While a great idea, "Write once, run anywhere" is still a myth. All JVMs have bugs in them, and it is simply impossible to develop a large Java program on one platform and expect it to work flawlessly on another. Not to say all problems have been eliminated from wxWidgets, but the situation is definately not worse. 
&lt;LI&gt;wxWidgets is in many ways more complete and more intuitive. Compare wxString with &lt;A href="http://java.sun.com/j2se/1.4.1/docs/api/java/lang/String.html"&gt;[java.lang.String]&lt;/A&gt;. Be sure to compare both the features, and the quality of the documentation. 
&lt;LI&gt;Some Java advocates claim that the next version of the JVM will fix many speed problems. However, &lt;A href="http://www.shudo.net/jit/perf/"&gt;[benchmark tests do not reflect this]&lt;/A&gt;. 
&lt;LI&gt;&lt;A href="http://verify.stanford.edu/uli/java_cpp.html"&gt;[Benchmarks]&lt;/A&gt; (using JVM server 1.4.0) show that Java is still significantly slower than C++. Significant enough to warrent the use of C++ over Java. &lt;/LI&gt;&lt;/UL&gt;
&lt;P&gt;
&lt;H2&gt;wxWidgets compared to SDL&lt;/H2&gt;
&lt;P&gt;
&lt;UL&gt;
&lt;LI&gt;&lt;A href="http://www.libsdl.org/"&gt;http://www.libsdl.org&lt;/A&gt; 
&lt;LI&gt;SDL (Simple DirectMedia Layer) is a multimedia C library more suited for when you're writing games and such, and want custom-everything and no convenient general-purpose UI elements. It is made of a lot of C structures starting with SDL_. 
&lt;LI&gt;Under the LGPL with the additional restriction that the source to SDL must be distributed with your application. &lt;/LI&gt;&lt;/UL&gt;
&lt;P&gt;
&lt;H2&gt;wxWidgets compared to Allegro&lt;/H2&gt;
&lt;P&gt;
&lt;UL&gt;
&lt;LI&gt;&lt;A href="http://alleg.sourceforge.net/"&gt;http://alleg.sourceforge.net&lt;/A&gt; 
&lt;LI&gt;Much like SDL, Allegro is a cross-platform c library (with quite a bit of assembly used in the backend) for programming games. 
&lt;LI&gt;Almost as old as wxWidgets (circa 1993). 
&lt;LI&gt;Giftware license (essentially public domain). 
&lt;LI&gt;Requires gcc and an assembler to build. 
&lt;LI&gt;Development has been stuck in the same version for years, there are a lack of core developers (original developer is no longer on the team), and there are some internal disputes which may lead to a fork. 
&lt;LI&gt;Very basic GUI functionality - only supports one window with only bare bones operations supported - you can't move the window, etc. 
&lt;LI&gt;"Controls" are sort of supported in allegro also through functions with (many) variable-length arguments, and are owner drawn much like QT (but don't look as good by default). They can be customized via a relatively easy API (and there are a few sub libraries that already have somewhat fair-looking versions). 
&lt;LI&gt;Drawing routines are much faster than wx, and there is a opengl layer (allegrogl - &lt;A href="http://allegrogl.sourceforge.net/"&gt;http://allegrogl.sourceforge.net/&lt;/A&gt;) that makes drawing with opengl even easier then it is to begin with. 
&lt;LI&gt;Non-GUI routines (input, etc.) are lower-level and generally faster than wxWidgets' native implementations. 
&lt;LI&gt;Can be used with wxWidgets without too much trouble - since allegro has some platform specific functions to get the window handle, you can create a wxWidgets window from the window handle and do what you want from that from that point on. While wxWindows uses a wxApp to handle platform-specific main/WinMain stuff, Allegro requres you put END_OF_MAIN() after your main function - getting the two to work together is somewhat of a task, but not a very large one. &lt;/LI&gt;&lt;/UL&gt;
&lt;P&gt;
&lt;H2&gt;wxWidgets compared to GTK+&lt;/H2&gt;
&lt;P&gt;
&lt;UL&gt;
&lt;LI&gt;&lt;A href="http://www.gtk.org/"&gt;http://www.gtk.org&lt;/A&gt; 
&lt;LI&gt;GTK+, originally the Gimp toolkit, is a GPL GUI library for Unix systems, written in C. It has been ported to Windows, VMS, and other systems (MacOS?) using the same API. 
&lt;LI&gt;GTKs Windows support is... miserable, not to be too blunt. It has nothing even remotely resembling native look and feel or behavior, and there are many drawing/flicker problems. If you are satisfied with the look and functionality of GTK on Windows, you probably weren't the target audience for wxWidgets anyway. 
&lt;LI&gt;Unlike wxWidgets, GTK+ supports C (and there is a C++ wrapper called GTKMM) 
&lt;LI&gt;The API is quite well developed, and includes safe casting and other things; but C++ has these built in. 
&lt;LI&gt;It's built on top of glib, a general-purpose library (similar in some ways to the C++ STL -- it provides a few data structures, functions to help memory management, etc). 
&lt;LI&gt;It looks the same on all platforms, except Windows XP, where it tries (with some success) to emulate Windows' native look and feel. However, it's still very much a Unix library. 
&lt;LI&gt;Since wxWidgets uses GTK (or GTK2) on Unix, there seems to be little reason to use GTK over wxWidgets in a C++ program. &lt;/LI&gt;&lt;/UL&gt;
&lt;P&gt;
&lt;H2&gt;wxWidgets compared to Kylix&lt;/H2&gt;
&lt;UL&gt;
&lt;LI&gt;Kylix hasn't been much of a success for Borland/Inprise, so it's doubtful how long it will be continued to be supported. 
&lt;LI&gt;Kylix is based on Qt, see above :) 
&lt;LI&gt;Fewer platforms are supported by Kylix 
&lt;LI&gt;The IDE, being based on no less than 3 toolkits, is rather unprofessional. &lt;/LI&gt;&lt;/UL&gt;
&lt;P&gt;
&lt;H2&gt;wxWidgets compared to Ultimate++&lt;/H2&gt;
&lt;UL&gt;
&lt;LI&gt;Ultimate++ only supports Windows and Linux, not MacOS 
&lt;LI&gt;The comparision on &lt;A href="http://upp.sourceforge.net/vswx.html"&gt;http://upp.sourceforge.net/vswx.html&lt;/A&gt; isn't really fair. The (very old) wxWidgets sample they took is well-commented and well-structured to show the reader how to design a wxWidgets application. Their implementation is uncommented and doesn't even behave the same. Also, a small example like that doesn't show how the toolkit scales to bigger applications. &lt;/LI&gt;&lt;/UL&gt;
&lt;P&gt;
&lt;H2&gt;wxWidgets compared to Notus&lt;/H2&gt;
&lt;P&gt;
&lt;UL&gt;
&lt;LI&gt;See: &lt;A href="http://sourceforge.net/projects/notus"&gt;http://sourceforge.net/projects/notus&lt;/A&gt; 
&lt;LI&gt;wxWidgets actually exists ;) 
&lt;LI&gt;notus is likely to make a lot more use of standard library and modern C++ concepts, such as iterators, templates, namespaces, etc (whereas wxWidgets reimplements or works around many of these things in non-standard ways); and it's also likely to follow the design principles of Boost (which you could consider either a good or bad thing), and work well with the rest of the Boost library. Of course, since it doesn't yet exist, whether this is true in practice remains to be seen. &lt;/LI&gt;&lt;/UL&gt;
&lt;P&gt;
&lt;H2&gt;wxWidgets compared to MFC&lt;/H2&gt;
&lt;P&gt;
&lt;UL&gt;
&lt;LI&gt;MFC is only available for free for Windows 
&lt;UL&gt;
&lt;LI&gt;A macintosh version was (is?) available with Visual C++ Crossplatform Edition (~$800 at last check), and also comes with CodeWarrior 
&lt;LI&gt;There are also UNIX variants such as MainWin, which are extremely expensive, require runtime licenses, and are reported to have problematic support &lt;/LI&gt;&lt;/UL&gt;
&lt;LI&gt;While the source for both wxWidgets and MFC is available, EULAs are not a concern with wxWidgets. 
&lt;LI&gt;MFC has a smaller executable size than wx (generally irrelevant with a decent compiler). 
&lt;LI&gt;MFC has greater range of good quality commercial components. 
&lt;LI&gt;Some say event tables (wxWidgets) are 'better' than message maps (MFC). 
&lt;LI&gt;wx's class hierarchy is more intuitive, while MFC tends to be more consistent among top-level class names. 
&lt;LI&gt;wx provides a far greater abundance of convenience classes, while MFC provides more windows-specific classes. 
&lt;LI&gt;.NET isn't an issue - MFC won't be ported to .NET. On the other hand, wx already has .NET wrappers in alpha stage! 
&lt;LI&gt;MFC has a broader range of components available, especially data-bound controls. 
&lt;LI&gt;Some things are easier with wxWidgets, such as certain types of windows (always on top, etc.), while other things are easier with MFC, such as detachable toolbars. 
&lt;LI&gt;Probably the strongest point to use MFC is MSVC, the IDE, itself. 
&lt;LI&gt;For info on class names and other points, see &lt;A class=wikipagelink href="http://wiki.wxwidgets.org/wiki.pl?WxWidgets_For_MFC_Programmers"&gt;wxWidgets for MFC programmers&lt;/A&gt; &lt;/LI&gt;&lt;/UL&gt;
&lt;P&gt;
&lt;H2&gt;wxWidgets compared to the Mozilla framework&lt;/H2&gt;
&lt;P&gt;
&lt;UL&gt;
&lt;LI&gt;See: &lt;A href="http://www.mozilla.org/why/framework.html"&gt;http://www.mozilla.org/why/framework.html&lt;/A&gt; 
&lt;LI&gt;JavaScript, XUL and C++ are all needed to program in Mozilla; wxWindows only needs C++. 
&lt;LI&gt;Programming Mozilla in C++ (XPCOM) is very difficult; C++ in wxWindows is easier. &lt;/LI&gt;&lt;/UL&gt;
&lt;P&gt;
&lt;H2&gt;So, why not use wxWidgets?&lt;/H2&gt;
&lt;P&gt;
&lt;UL&gt;
&lt;LI&gt;No commercial-grade resource editors specifically made for wxWidgets (although some have been built with wxWidgets!). 
&lt;LI&gt;Lack of commercial GUI components for making nice GUI themes, grids, charts, etc (will usually have to hack the wxWidgets source code itself to get these results). 
&lt;UL&gt;
&lt;LI&gt;This is incorrect - you do not need to edit the wx library source to add new widgets, not even complicated ones. You would need to if you wanted to add theme support. &lt;/LI&gt;&lt;/UL&gt;
&lt;LI&gt;X11 port is very sub-par compared to other toolkits and very instable. You should use the wxGTK port instead, which builds upon GTK instead of directly onto X11. &lt;/LI&gt;&lt;/UL&gt;&lt;/DIV&gt;
&lt;HR class=wikilinefooter&gt;

&lt;DIV class=wikifooter&gt;
&lt;FORM action=wiki.pl method=post&gt;&lt;A class=wikipagelink href="http://wiki.wxwidgets.org/wiki.pl?WxWiki"&gt;WxWiki&lt;/A&gt; | &lt;A class=wikipagelink href="http://wiki.wxwidgets.org/wiki.pl?RecentChanges"&gt;RecentChanges&lt;/A&gt; | &lt;A href="http://wiki.wxwidgets.org/wiki.pl?action=editprefs"&gt;Log in/Preferences&lt;/A&gt;&lt;BR&gt;Log in to edit this page | &lt;A href="http://wiki.wxwidgets.org/wiki.pl?action=history&amp;amp;id=WxWidgets_Compared_To_Other_Toolkits"&gt;View other revisions&lt;/A&gt;&lt;BR&gt;Last edited May 3, 2005 21:45 by &lt;A title="ID 5073 from PC43-178.dordt.edu" href="http://wiki.wxwidgets.org/wiki.pl?Natevw"&gt;Natevw&lt;/A&gt; &lt;A href="http://wiki.wxwidgets.org/wiki.pl?action=browse&amp;amp;diff=1&amp;amp;id=WxWidgets_Compared_To_Other_Toolkits"&gt;(diff)&lt;/A&gt;&lt;BR&gt;&lt;/FORM&gt;
&lt;FORM action=docs.cgi method=get target=_top&gt;
&lt;TABLE border=1&gt;
&lt;TBODY&gt;
&lt;TR&gt;
&lt;TD&gt;&lt;INPUT name=q&gt; &lt;INPUT type=submit value=Find&gt; &lt;/TD&gt;&lt;/TR&gt;
&lt;TR&gt;
&lt;TD&gt;&lt;INPUT type=checkbox value=class name=target&gt;class &lt;INPUT type=checkbox value=google name=target&gt;google &lt;INPUT type=checkbox CHECKED value=wiki name=target&gt;wiki &lt;INPUT type=checkbox value=lists name=target&gt;lists &lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;/FROM&gt;
&lt;DIV&gt;&lt;/DIV&gt;&lt;/FORM&gt;
&lt;P align=right&gt;&lt;FONT size=-2&gt;&lt;I&gt;the wxWiki is hosted and maintained by &lt;A href="mailto:arnoutwiki@bzzt.net"&gt;Arnout Engelen&lt;/A&gt; (raboof on IRC)&lt;/I&gt;&lt;/FONT&gt;&lt;/P&gt;&lt;/DIV&gt;&lt;img src ="http://blog.vckbase.com/bastet/aggbug/6274.html" width = "1" height = "1" /&gt;</description></item><item><dc:creator>Diviner</dc:creator><title>spring-4 </title><link>http://blog.vckbase.com/bastet/archive/2005/06/08/6220.html</link><pubDate>Wed, 08 Jun 2005 00:32:00 GMT</pubDate><guid>http://blog.vckbase.com/bastet/archive/2005/06/08/6220.html</guid><wfw:comment>http://blog.vckbase.com/bastet/comments/6220.html</wfw:comment><comments>http://blog.vckbase.com/bastet/archive/2005/06/08/6220.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://blog.vckbase.com/bastet/comments/commentRss/6220.html</wfw:commentRss><trackback:ping>http://blog.vckbase.com/bastet/services/trackbacks/6220.html</trackback:ping><description>&lt;P&gt;Spring in Action: A Spring Jump Start. Part 1&lt;BR&gt;The GreetingServiceImpl class has a single property: the greeting property. This property is simply a String that holds the text that is the message that will be printed when the sayGreeting() method is called. You may have noticed that the greeting can be set in two different ways: by the constructor or by the property抯 setter method.&lt;/P&gt;
&lt;P&gt;What抯 not apparent just yet is who will make the call to either the constructor or the setGreeting() method to set the property. As it turns out, we抮e going to let the Spring container set the greeting property. The Spring configuration file (hello.xml) in listing 1.3 tells the container how to configure the greeting service.&lt;/P&gt;
&lt;P&gt;Listing 1.3 Configuring Hello World in Spring &lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;The XML file in listing 1.3 declares an instance of a GreetingServiceImpl in the Spring container and configures its greeting property with a value of 揃uenos Dias!?Let抯 dig into the details of this XML file a bit to understand how it works. At the root of this simple XML file is the element, which is the root element of any Spring configuration file. The element is used to tell the Spring container about a class and how it should be configured. Here, the id attribute is used to name the bean greetingService and the class attribute specifies the bean抯 fully qualified class name.&lt;/P&gt;
&lt;P&gt;Within the element, the element is used to set a property, in this case the greeting property. By using , we抮e telling the Spring container to call setGreeting() when setting the property.&lt;/P&gt;
&lt;P&gt;The value of the greeting is defined within the element. Here we抳e given the example a Spanish flair by choosing 揃uenos Dias?instead of the traditional 揌ello World.?/p&amp;gt; &lt;/P&gt;
&lt;P&gt;The following snippet of code illustrates roughly what the container does when instantiating the greeting service based on the XML definition in listing 1.3:2&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; GreetingServiceImpl greetingService = new GreetingServiceImpl();&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; greetingService.setGreeting("Buenos Dias!"); &lt;BR&gt;Similarly, we may choose to have Spring set the greeting property through GreetingServiceImpl抯 single argument constructor. For example:&lt;/P&gt;
&lt;P&gt;Similarly, we may choose to have Spring set the greeting property through GreetingServiceImpl抯 single argument constructor. For example:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;The following code illustrates how the container will instantiate the greeting service when using the element:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; GreetingServiceImpl greetingService =&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; new GreetingServiceImpl(揃uenos Dias?; &lt;BR&gt;The last piece of the puzzle is the class that loads the Spring container and uses it to retrieve the greeting service. Listing 1.4 shows this class.&lt;/P&gt;
&lt;P&gt;2 The container actually performs other activities involving the life cycle of the bean. But for illustrative purposes, these two lines are sufficient.&lt;/P&gt;
&lt;P&gt;Listing 1.4 The Hello World main class &lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;The BeanFactory class used here is the Spring container. After loading the hello.xml file into the container, the main() method calls the getBean() method on the BeanFactory to retrieve a reference to the greeting service. With this reference in hand, it finally calls the sayGreeting() method. When we run the Hello application, it prints (not surprisingly)&lt;/P&gt;
&lt;P&gt;Buenos Dias!&lt;/P&gt;
&lt;P&gt;This is about as simple a Spring-enabled application as we can come up with. But it does illustrate the basics of configuring and using a class in Spring. Unfortunately, it is perhaps too simple because it only illustrates how to configure a bean by injecting a String value into a property. The real power of Spring lies in how beans can be injected into other beans using IoC.&lt;/P&gt;
&lt;P&gt;Next week, we begin with Understanding inversion of control.&lt;/P&gt;
&lt;P&gt;Spring in Action: A Spring Jump Start is written by Craig Walls and Ryan Breidenbach and reproduced from "Spring in Action" by permission of Manning Publications Co. ISBN 1932394354, copyright 2005. All rights reserved. See &lt;A href="http://www.manning.com"&gt;http://www.manning.com&lt;/A&gt; for more information.&lt;/P&gt;&lt;img src ="http://blog.vckbase.com/bastet/aggbug/6220.html" width = "1" height = "1" /&gt;</description></item><item><dc:creator>Diviner</dc:creator><title>spring -3</title><link>http://blog.vckbase.com/bastet/archive/2005/06/08/6219.html</link><pubDate>Wed, 08 Jun 2005 00:30:00 GMT</pubDate><guid>http://blog.vckbase.com/bastet/archive/2005/06/08/6219.html</guid><wfw:comment>http://blog.vckbase.com/bastet/comments/6219.html</wfw:comment><comments>http://blog.vckbase.com/bastet/archive/2005/06/08/6219.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://blog.vckbase.com/bastet/comments/commentRss/6219.html</wfw:commentRss><trackback:ping>http://blog.vckbase.com/bastet/services/trackbacks/6219.html</trackback:ping><description>&lt;H3&gt;Spring in Action: A Spring Jump Start. Part 1&lt;/H3&gt;
&lt;H3&gt;The core container&lt;/H3&gt;
&lt;P&gt;Spring抯 core container provides the fundamental functionality of the Spring framework. In this module you抣l find Spring抯 &lt;CODE&gt;BeanFactory&lt;/CODE&gt;, the heart of any Spring-based application. A &lt;CODE&gt;BeanFactory&lt;/CODE&gt; is an implementation of the factory pattern that applies IoC to separate your application抯 configuration and dependency specifications from the actual application code.&lt;/P&gt;
&lt;P&gt;We抣l be discussing the core module (the center of any Spring application) throughout this book, starting in chapter 2, when we cover bean wiring using IoC.&lt;/P&gt;
&lt;H3&gt;Application context module&lt;/H3&gt;
&lt;P&gt;The core module抯 &lt;CODE&gt;BeanFactory&lt;/CODE&gt; makes Spring a container, but the context module is what makes it a framework. This module extends the concept of &lt;CODE&gt;BeanFactory&lt;/CODE&gt;, adding support for internationalization (I18N) messages, application life cycle events, and validation.&lt;/P&gt;
&lt;P&gt;In addition, this module supplies many enterprise services such as e-mail, JNDI access, EJB integration, remoting, and scheduling. Also included is support for integration with templating frameworks such as Velocity and FreeMarker.&lt;/P&gt;
&lt;H3&gt;Spring抯 AOP module&lt;/H3&gt;
&lt;P&gt;Spring provides rich support for aspect-oriented programming in its AOP module. This module serves as the basis for developing your own aspects for your Spring-enabled application.&lt;/P&gt;
&lt;P&gt;To ensure interoperability between Spring and other AOP frameworks, much of Spring抯 AOP support is based on the API defined by the AOP Alliance. The AOP Alliance is an open-source project whose goal is to promote adoption of AOP and interoperability among different AOP implementations by defining a common set of interfaces and components. You can find out more about the AOP Alliance by visiting their website at http://aopalliance.sourceforge.net. The Spring AOP module also introduces metadata programming to Spring. Using Spring抯 metadata support, you are able to add annotations to your source code that instruct Spring on where and how to apply aspects.&lt;/P&gt;
&lt;H3&gt;JDBC abstraction and the DAO module&lt;/H3&gt;
&lt;P&gt;Working with JDBC often results in a lot of boilerplate code that gets a connection, creates a statement, processes a result set, and then closes the connection. Spring抯 JDBC and Data Access Objects (DAO) module abstracts away the boilerplate code so that you can keep your database code clean and simple, and prevents problems that result from a failure to close database resources. This module also builds a layer of meaningful exceptions on top of the error messages given by several database servers. No more trying to decipher cryptic and proprietary SQL error messages!&lt;/P&gt;
&lt;P&gt;In addition, this module uses Spring抯 AOP module to provide transaction management services for objects in a Spring application.&lt;/P&gt;
&lt;H3&gt;Object/relational mapping integration module&lt;/H3&gt;
&lt;P&gt;For those who prefer using an object/relational mapping (ORM) tool over straight JDBC, Spring provides the ORM module. Spring doesn抰 attempt to implement its own ORM solution, but does provide hooks into several popular ORM frameworks, including Hibernate, JDO, and iBATIS SQL Maps. Spring抯 transaction management supports each of these ORM frameworks as well as JDBC.&lt;/P&gt;
&lt;H3&gt;Spring抯 web module&lt;/H3&gt;
&lt;P&gt;The web context module builds on the application context module, providing a context that is appropriate for web-based applications. In addition, this module contains support for several web-oriented tasks such as transparently handling multipart requests for file uploads and programmatic binding of request parameters to your business objects. It also cotains integration support with Jakarta Struts.&lt;/P&gt;
&lt;H3&gt;The Spring MVC framework&lt;/H3&gt;
&lt;P&gt;Spring comes with a full-featured Model/View/Controller (MVC) framework for building web applications. Although Spring can easily be integrated with other MVC frameworks, such as Struts, Spring抯 MVC framework uses IoC to provide for a clean separation of controller logic from business objects. It also allows you to declaratively bind request parameters to your business objects, What抯 more, Spring抯 MVC framework can take advantage of any of Spring抯 other services, such as I18N messaging and validation.&lt;/P&gt;
&lt;P&gt;Now that you know what Spring is all about, let抯 jump right into writing Spring applications, starting with the simplest possible example that we could come up with.&lt;/P&gt;
&lt;H3&gt;1.3 Spring jump start&lt;/H3&gt;
&lt;P&gt;In the grand tradition of programming books, we抣l start by showing you how Spring works with the proverbial 揌ello World?example. Unlike the original Hello World program, however, our example will be modified a bit to demonstrate the basics of Spring.&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;NOTE &lt;/STRONG&gt;To find out how to download Spring and plug it into your project抯 build routine, refer to appendix A.&lt;/P&gt;
&lt;P&gt;Spring-enabled applications are like any Java application. They are made up of several classes, each performing a specific purpose within the application. What makes Spring-enabled applications different, however, is how these classes are configured and introduced to each other. Typically, a Spring application has an XML file that describes how to configure the classes, known as the Spring configuration file.&lt;/P&gt;
&lt;P&gt;The first class that our Springified Hello World example needs is a service class whose purpose is to print the infamous greeting. Listing 1.1 shows &lt;CODE&gt;GreetingService.java&lt;/CODE&gt;, an interface that defines the contract for our service class.&lt;/P&gt;
&lt;TABLE borderColor=#cccccc cellSpacing=5 cellPadding=5 width="100%" border=0&gt;
&lt;TBODY&gt;
&lt;TR&gt;
&lt;TD bgColor=#cccccc&gt;&lt;STRONG&gt;Listing 1.1 The &lt;CODE&gt;GreetingService&lt;/CODE&gt; interface separates the service抯 implementation from its interface.&lt;/STRONG&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;
&lt;TABLE cellSpacing=0 cellPadding=0 width="100%" border=0&gt;
&lt;TBODY&gt;
&lt;TR&gt;
&lt;TD&gt;
&lt;UL&gt;&lt;CODE&gt;package com.springinaction.chapter01.hello; 
&lt;P&gt;public interface GreetingService {&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;public void sayGreeting();&lt;BR&gt;}&lt;/CODE&gt;&lt;/P&gt;&lt;/UL&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;GreetingServiceImpl.java (listing 1.2) implements the &lt;CODE&gt;GreetingService&lt;/CODE&gt; interface. Although it抯 not necessary to hide the implementation behind an interface, it抯 highly recommended as a way to separate the implementation from its contract. 
&lt;P&gt;
&lt;TABLE cellSpacing=5 cellPadding=5 width="100%" bgColor=#cccccc border=0&gt;
&lt;TBODY&gt;
&lt;TR&gt;
&lt;TD&gt;&lt;STRONG&gt;Listing 1.2 &lt;CODE&gt;GreetingServiceImpl.java&lt;/CODE&gt;: Responsible for printing the greeting&lt;/STRONG&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;
&lt;P&gt;&lt;IMG src="http://www.webreference.com/programming/spring/listing1-2.gif"&gt;&lt;/P&gt;&lt;!-- content_stop --&gt;
&lt;P&gt;&lt;/P&gt;
&lt;TABLE width="100%" align=center border=0&gt;
&lt;TBODY&gt;
&lt;TR vAlign=top&gt;
&lt;TD align=left&gt;&lt;STRONG&gt;&lt;A href="http://www.webreference.com/"&gt;home&lt;/A&gt; / &lt;A href="http://www.webreference.com/programming/"&gt;programming&lt;/A&gt; / &lt;A href="http://www.webreference.com/programming/spring/"&gt;spring&lt;/A&gt; &lt;/STRONG&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;img src ="http://blog.vckbase.com/bastet/aggbug/6219.html" width = "1" height = "1" /&gt;</description></item><item><dc:creator>Diviner</dc:creator><title>Spring -2</title><link>http://blog.vckbase.com/bastet/archive/2005/06/08/6218.html</link><pubDate>Wed, 08 Jun 2005 00:29:00 GMT</pubDate><guid>http://blog.vckbase.com/bastet/archive/2005/06/08/6218.html</guid><wfw:comment>http://blog.vckbase.com/bastet/comments/6218.html</wfw:comment><comments>http://blog.vckbase.com/bastet/archive/2005/06/08/6218.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://blog.vckbase.com/bastet/comments/commentRss/6218.html</wfw:commentRss><trackback:ping>http://blog.vckbase.com/bastet/services/trackbacks/6218.html</trackback:ping><description>&lt;H3&gt;Spring in Action: A Spring Jump Start. Part 1&lt;/H3&gt;
&lt;H3&gt;Good design is more important than the underlying technology&lt;/H3&gt;
&lt;P&gt;As a developer, you should always be seeking the best design for your application, regardless of the implementation you choose. Sometimes the complexity of EJB is warranted because of the requirements of the application. Often, this is not the case. Many applications require few, if any, of the services provided by EJB yet are still implemented using this technology for technology抯 sake. If an application does not require distribution or declarative transaction support, it is unlikely that EJB is the best technology candidate. Yet many Java developers feel compelled to use EJB for every Java enterprise application.&lt;/P&gt;
&lt;P&gt;The idea behind Spring is that you can keep your code as simple as it needs to be. If what you want are some plain-vanilla Java objects to perform some services supported by transparent transactions, you抳e got it. And you don抰 need an EJB container, and you don抰 have to implement special interfaces. You just have to write your code.&lt;/P&gt;
&lt;H3&gt;JavaBeans loosely coupled through interfaces is a good model&lt;/H3&gt;
&lt;P&gt;If you are relying on EJBs to provide your application services, your components do not just depend on the EJB business interface. They are also responsible for retrieving these EJB objects from a directory, which entails a Java Naming and Directory Interface (JNDI) lookup and communicating with the bean抯 EJBHome interface. This is not creating a decoupled application. This is tightly coupling your application to a specific implementation, namely EJB.&lt;/P&gt;
&lt;P&gt;With Spring, your beans depend on collaborators through interfaces. Since there are no implementation-specific dependencies, Spring applications are very decoupled, testable, and easier to maintain. And because the Spring container is responsible for resolving the dependencies, the active service lookup that is involved in EJB is now out of the picture and the cost of programming to interfaces is minimized. All you need to do is create classes that communicate with each other through interfaces, and Spring takes care of the rest.&lt;/P&gt;
&lt;H3&gt;Code should be easy to test&lt;/H3&gt;
&lt;P&gt;Testing J2EE applications can be difficult. If you are testing EJBs within a container, you have to start up a container to execute even the most trivial of test cases. Since starting and stopping a container is expensive, developers may be tempted to skip testing all of their components. Avoiding tests because of the rigidness of a framework is not a good excuse.&lt;/P&gt;
&lt;P&gt;Because you develop Spring applications with JavaBeans, testing is cheap. There is no J2EE container to be started since you will be testing a POJO. And since Spring makes coding to interfaces easy, your objects will be loosely coupled, making testing even easier. A thorough battery of tests should be present in all of your applications; Spring will help you accomplish this.&lt;/P&gt;
&lt;H3&gt;1.2 What is Spring?&lt;/H3&gt;
&lt;P&gt;Spring is an open-source framework, created by Rod Johnson and described in his book &lt;EM&gt;Expert One-on-One: J2EE Design and Development&lt;/EM&gt;.&lt;STRONG&gt;&lt;FONT size=-1&gt;1&lt;/FONT&gt;&lt;/STRONG&gt; It was created to address the complexity of enterprise application development. Spring makes it possible to use plain-vanilla JavaBeans to achieve things that were previously only possible with EJBs. However, Spring抯 usefulness isn抰 limited to server-side development. Any Java application can benefit from Spring in terms of simplicity, testability, and loose coupling.&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;NOTE &lt;/STRONG&gt;To avoid ambiguity, we抣l use the term 揈JB?when referring to Enterprise JavaBeans. When referring to the original JavaBean, we抣l call it 揓avaBean,?or 揵ean?for short. Some other terms we may throw around are 揚OJO?(which stands for 損lain old Java object? or 揚OJI?(which means 損lain old Java interface?.&lt;/P&gt;
&lt;P&gt;Put simply, Spring is a lightweight inversion of control and aspect-oriented container framework. Okay, that抯 not so simple a description. But it does summarize what Spring does. To make more sense of Spring, let抯 break this description down:&lt;/P&gt;
&lt;UL&gt;
&lt;LI&gt;
&lt;P&gt;&lt;STRONG&gt;Lightweight&lt;/STRONG&gt; - Spring is lightweight in terms of both size and overhead. The entire Spring framework can be distributed in a single JAR file that weighs in at just over 1 MB. And the processing overhead required by Spring is negligible. What's more, Spring is nonintrusive: objects in a Spring-enabled application typically have no dependencies on Springspecific classes.&lt;/P&gt;
&lt;LI&gt;
&lt;P&gt;&lt;STRONG&gt;Inversion of control&lt;/STRONG&gt; - Spring promotes loose coupling through a technique known as inversion of control (IoC). When IoC is applied, objects are passively given their dependencies instead of creating or looking for dependent objects for themselves. You can think of IoC as JNDI in reverse - instead of an object looking up dependencies from a container, the container gives the dependencies to the object at instantiation without waiting to be asked.&lt;/P&gt;
&lt;LI&gt;
&lt;P&gt;&lt;STRONG&gt;Aspect-oriented&lt;/STRONG&gt; - Spring comes with rich support for aspect-oriented programming that enables cohesive development by separating application business logic from system services (such as auditing and transaction management). Application objects do what they're supposed to do - perform business logic - and nothing more. They are not responsible for (or even aware of) other system concerns, such as logging or transactional support.&lt;/P&gt;
&lt;LI&gt;
&lt;P&gt;&lt;STRONG&gt;Container&lt;/STRONG&gt; - Spring is a container in the sense that it contains and manages the life cycle and configuration of application objects. You can configure how your each of your beans should be created - either create one single instance of your bean or produce a new instance every time one is needed based on a configurable prototype - and how they should be associated with each other. Spring should not, however, be confused with traditionally heavyweight EJB containers, which are often large and cumbersome to work with.&lt;/P&gt;
&lt;LI&gt;
&lt;P&gt;&lt;STRONG&gt;Framework&lt;/STRONG&gt; - Spring makes it possible to configure and compose complex applications from simpler components. In Spring, application objects are composed declaratively, typically in an XML file. Spring also provides much infrastructure functionality (transaction management, persistence framework integration, etc.), leaving the development of application logic to you.&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;FONT size=-1&gt;1 In this book, Spring was originally called "interface21."&lt;/FONT&gt; 
&lt;P&gt;All of these attributes of Spring enable you to write code that is cleaner, more manageable, and easier to test. They also set the stage for a variety of subframeworks within the greater Spring framework.&lt;/P&gt;
&lt;H3&gt;1.2.1 Spring modules&lt;/H3&gt;
&lt;P&gt;The Spring framework is made up of seven well-defined modules (figure 1.1). When taken as a whole, these modules give you everything you need to develop enterprise-ready applications. But you do not have to base your application fully on the Spring framework. You are free to pick and choose the modules that suit your application and ignore the rest.&lt;/P&gt;
&lt;P&gt;As you can see, all of Spring抯 modules are built on top of the core container. The container defines how beans are created, configured, and managed梞ore of the nuts-and-bolts of Spring. You will implicitly use these classes when you configure your application. But as a developer, you will most likely be interested in the other modules that leverage the services provided by the container. These modules will provide the frameworks with which you will build your application抯 services, such as AOP and persistence.&lt;/P&gt;
&lt;P&gt;&lt;IMG src="http://www.webreference.com/programming/spring/fig1-1.jpg"&gt;&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;Figure 1.1&lt;/STRONG&gt; The Spring framework is composed of several well-defined modules.&lt;/P&gt;&lt;img src ="http://blog.vckbase.com/bastet/aggbug/6218.html" width = "1" height = "1" /&gt;</description></item><item><dc:creator>Diviner</dc:creator><title>Sping -1</title><link>http://blog.vckbase.com/bastet/archive/2005/06/08/6217.html</link><pubDate>Wed, 08 Jun 2005 00:28:00 GMT</pubDate><guid>http://blog.vckbase.com/bastet/archive/2005/06/08/6217.html</guid><wfw:comment>http://blog.vckbase.com/bastet/comments/6217.html</wfw:comment><comments>http://blog.vckbase.com/bastet/archive/2005/06/08/6217.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://blog.vckbase.com/bastet/comments/commentRss/6217.html</wfw:commentRss><trackback:ping>http://blog.vckbase.com/bastet/services/trackbacks/6217.html</trackback:ping><description>&lt;H2&gt;Spring in Action: A Spring Jump Start. Part 1&lt;/H2&gt;
&lt;P&gt;Written by Craig Walls and Ryan Breidenbach and reproduced from &lt;A href="http://books.internet.com/books/1932394354"&gt;&lt;STRONG&gt;"Spring in Action"&lt;/STRONG&gt;&lt;/A&gt; by permission of &lt;A href="http://www.manning.com/"&gt;&lt;STRONG&gt;Manning Publications Co.&lt;/STRONG&gt;&lt;/A&gt; ISBN 1932394354, copyright 2005. All rights reserved. See &lt;A href="http://www.manning.com/catalog/view.php?book=walls2"&gt;&lt;STRONG&gt;http://www.manning.com&lt;/STRONG&gt;&lt;/A&gt;&lt;STRONG&gt; &lt;/STRONG&gt;for more information.&lt;/P&gt;This chapter covers 
&lt;P&gt;
&lt;TABLE width="100%" border=0&gt;
&lt;TBODY&gt;
&lt;TR&gt;
&lt;TD&gt;
&lt;UL&gt;
&lt;LI&gt;
&lt;P&gt;Creating simpler J2EE applications using Spring&lt;/P&gt;
&lt;LI&gt;
&lt;P&gt;Decoupling components with inversion of control&lt;/P&gt;
&lt;LI&gt;
&lt;P&gt;Managing cross-cutting concerns with aspectoriented programming&lt;/P&gt;
&lt;LI&gt;
&lt;P&gt;Comparing the features of Spring and EJB&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;It all started with a bean. 
&lt;P&gt;
&lt;P&gt;In 1996 the Java programming language was still a young, exciting, up-and coming platform. Many developers flocked to the language because they had seen how to create rich and dynamic web applications using applets. But they soon learned that there was more to this strange new language than animated juggling cartoon characters. Unlike any language before it, Java made it possible to write complex applications made up of discrete parts. They came for the applets, but they stayed for the components.&lt;/P&gt;
&lt;P&gt;It was in December of that year that Sun Microsystems published the Java- Beans 1.00-A specification. JavaBeans defined a software component model for Java. This specification defined a set of coding policies that enabled simple Java objects to be reusable and easily composed into more complex applications. Although JavaBeans were intended as a general-purpose means of defining reusable application components, they have been primarily used as a model for building user interface widgets. They seemed too simple to be capable of any 搑eal? work. Enterprise developers wanted more.&lt;/P&gt;
&lt;P&gt;Sophisticated applications often require services such as transaction support, security, and distributed computing梥ervices not directly provided by the Java- Beans specification. Therefore, in March 1998, Sun published the 1.0 version of the Enterprise JavaBeans (EJB) specification. This specification extended the notion of Java components to the server side, providing the much-needed enterprise services, but failed to continue the simplicity of the original JavaBeans specification. In fact, except in name, EJB bears very little resemblance to the original JavaBeans specification.&lt;/P&gt;
&lt;P&gt;Despite the fact that many successful applications have been built based on EJB, EJB never really achieved its intended purpose: to simplify enterprise application development. Every version of the EJB specification contains the following statement: 揈nterprise JavaBeans will make it easy to write applications.?It is true that EJB抯 declarative programming model simplifies many infrastructural aspects of development, such as transactions and security. But EJBs are complicated in a different way by mandating deployment descriptors and plumbing code (home and remote/local interfaces). Over time many developers became disenchanted with EJB. As a result, its popularity has started to wane in recent years, leaving many developers looking for an easier way.&lt;/P&gt;
&lt;P&gt;Now Java component development is coming full circle. New programming techniques, including aspect-oriented programming (AOP) and inversion of control (IoC), are giving JavaBeans much of the power of EJB. These techniques furnish JavaBeans with a declarative programming model reminiscent of EJB, but without all of EJB抯 complexity. No longer must you resort to writing an unwieldy EJB component when a simple JavaBean will suffice.&lt;/P&gt;
&lt;P&gt;And that抯 where Spring steps into the picture.&lt;/P&gt;
&lt;H3&gt;1.1 Why Spring?&lt;/H3&gt;
&lt;P&gt;If you are reading this book, you probably want to know why Spring would be good for you. After all, the Java landscape is full of frameworks. What makes Spring any different? To put it simply, Spring makes developing enterprise applications easier. We don抰 expect that to convince you at face value, so first let抯 take a look at life without Spring.&lt;/P&gt;
&lt;H3&gt;1.1.1 A day in the life of a J2EE developer&lt;/H3&gt;
&lt;P&gt;Alex is a Java developer who has just started on his first enterprise application. Like many Java 2 Enterprise Edition (J2EE) applications, it is a web application that serves many users and accesses an enterprise database. In this case, it is a customer management application that will be used by other employees at his company. Eager to get to work, Alex fires up his favorite integrated development environment (IDE) and starts to crank out his first component, the &lt;CODE&gt;CustomerManager&lt;/CODE&gt; component. In the EJB world, to develop this component Alex actually has to write several classes梩he home interface, the local interface, and the bean itself. In addition, he has to create a deployment descriptor for this bean.&lt;/P&gt;
&lt;P&gt;Seeing that creating each of these files for &lt;EM&gt;every&lt;/EM&gt; bean seems like a lot of effort, Alex incorporates XDoclet into his project. XDoclet is a code generation tool that can generate all of the necessary EJB files from a single source file. Although this adds another step to Alex抯 development cycle, his coding life is now much simpler. With XDoclet now handling a lot of the grunt work for him, Alex turns his attention to his real problem梬hat exactly should the &lt;CODE&gt;CustomerManager&lt;/CODE&gt; component do? He jumps in with its first method, &lt;CODE&gt;getPreferredCustomer()&lt;/CODE&gt;. There are several business rules that define exactly what a preferred customer is, and Alex dutifully codes them into his &lt;CODE&gt;CustomerManager&lt;/CODE&gt; bean.&lt;/P&gt;
&lt;P&gt;Wanting to confirm that his logic is correct, Alex now wants to write some tests to validate his code. But then it occurs to him: the code he is testing will be running within the EJB container. Therefore, his tests need to execute within the container as well. To easily accomplish this, he concocts a servlet that will be responsible for executing these tests. Since all J2EE containers support servlets, this will allow him to execute his tests in the same container as his EJB. &lt;/P&gt;
&lt;P&gt;Problem solved!&lt;/P&gt;
&lt;P&gt;So Alex fires up his J2EE container and runs his tests. His tests fail. Alex sees his coding error, fixes it, and runs the tests again. His tests fail again. He sees another error and fixes it. He fires up the container and runs the tests again. As Alex is going through this cycle, he notices something. The fact that he has to start the J2EE container for each batch of testing really slows down his development cycle. The development cycle should go code, test, code, test. This pattern has now been replaced with code, wait, test, code, wait, test, code, wait, get increasingly frustrated!&lt;/P&gt;
&lt;P&gt;While waiting for the container to start during another test run, Alex thinks, "Why am I using EJB in the first place?" The answer, of course, is because of the services it provides. But Alex isn't using entity beans, so he is not using persistence services. Alex is also not using the remoting or security services. In fact, the only EJB service Alex is going to use is transaction management. This leads Alex to another question: "Is there an easier way?"&lt;/P&gt;
&lt;H3&gt;1.1.2 Spring's pledge&lt;/H3&gt;
&lt;P&gt;The above story was a dramatization based on the current state of J2EE - specifically EJB. In its current state, EJB is complicated. It isn't complicated just to be complicated. It is complicated because EJBs were created to solve complicated things, such as distributed objects and remote transactions.&lt;/P&gt;
&lt;P&gt;Unfortunately, a good number of enterprise projects do not have this level of complexity but still take on EJB's burden of multiple Java files and deployment descriptors and heavyweight containers. With EJB, application complexity is high, regardless of the complexity of the problem being solved - even simple applications are unduly complex. With Spring, the complexity of your application is proportional to the complexity of the problem being solved.&lt;/P&gt;
&lt;P&gt;However, Spring recognizes that EJB does offer developers valuable services. So Spring strives to deliver these same services while simplifying the programming model. In doing so, it adopts a simple philosophy: J2EE &lt;EM&gt;should&lt;/EM&gt; be easy to use. In keeping with this philosophy, Spring was designed with the following beliefs:&lt;/P&gt;
&lt;UL&gt;
&lt;LI&gt;
&lt;P&gt;Good design is more important than the underlying technology.&lt;/P&gt;
&lt;LI&gt;
&lt;P&gt;JavaBeans loosely coupled through interfaces is a good model.&lt;/P&gt;
&lt;LI&gt;
&lt;P&gt;Code should be easy to test.&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;
&lt;P&gt;Okay. So how does Spring help you apply this philosophy to your applications?&lt;/P&gt;&lt;img src ="http://blog.vckbase.com/bastet/aggbug/6217.html" width = "1" height = "1" /&gt;</description></item><item><dc:creator>Diviner</dc:creator><title>Struts VS Barracuda</title><link>http://blog.vckbase.com/bastet/archive/2005/06/08/6215.html</link><pubDate>Wed, 08 Jun 2005 00:19:00 GMT</pubDate><guid>http://blog.vckbase.com/bastet/archive/2005/06/08/6215.html</guid><wfw:comment>http://blog.vckbase.com/bastet/comments/6215.html</wfw:comment><comments>http://blog.vckbase.com/bastet/archive/2005/06/08/6215.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://blog.vckbase.com/bastet/comments/commentRss/6215.html</wfw:commentRss><trackback:ping>http://blog.vckbase.com/bastet/services/trackbacks/6215.html</trackback:ping><description>&lt;P&gt;&lt;!--#include virtual="/bodyOpen.ssi"--&gt;&lt;!--#include virtual="/commonNav.ssi"--&gt;&amp;nbsp;
&lt;TABLE cellSpacing=0 cellPadding=0 width=600 align=center bgColor=#ffffff border=0&gt;
&lt;TBODY&gt;
&lt;TR&gt;
&lt;TD vAlign=top&gt;
&lt;TABLE cellSpacing=0 cellPadding=0 width="100%" border=0&gt;
&lt;TBODY&gt;
&lt;TR&gt;
&lt;TD vAlign=top colSpan=5&gt;
&lt;P align=right&gt;&lt;EM&gt;&lt;SMALL&gt;
&lt;SCRIPT&gt;dm = document.lastModified; if (Date.parse(dm) != Date.parse(Date()) &amp;&amp; Date.parse(dm) != 0) document.writeln("Last Modified: " + dm);&lt;/SCRIPT&gt;
Last Modified: 01/07/2003 01:15:37 &lt;/SMALL&gt;&lt;/EM&gt;&lt;/P&gt;&lt;/TD&gt;&lt;/TR&gt;
&lt;TR&gt;
&lt;TD&gt;&lt;IMG height=1 src="http://barracudamvc.org/Barracuda/images/spacer.gif" width=2&gt;&lt;/TD&gt;
&lt;TD&gt;&lt;IMG height=1 src="http://barracudamvc.org/Barracuda/images/spacer.gif" width=11&gt;&lt;/TD&gt;
&lt;TD&gt;&lt;IMG height=1 src="http://barracudamvc.org/Barracuda/images/spacer.gif" width=576&gt;&lt;/TD&gt;
&lt;TD&gt;&lt;IMG height=1 src="http://barracudamvc.org/Barracuda/images/spacer.gif" width=11&gt;&lt;/TD&gt;
&lt;TD&gt;&lt;IMG height=1 src="http://barracudamvc.org/Barracuda/images/spacer.gif" width=2&gt;&lt;/TD&gt;&lt;/TR&gt;
&lt;TR&gt;
&lt;TD colSpan=2&gt;&lt;IMG height=25 src="http://barracudamvc.org/Barracuda/images/tl.gif" width=13&gt;&lt;/TD&gt;
&lt;TD vAlign=bottom width=576 bgColor=#000080 height=25&gt;&lt;FONT face=Arial color=#ffffff&gt;&lt;STRONG&gt;Barracuda - Framework Comparisons&lt;/STRONG&gt;&lt;/FONT&gt;&lt;/TD&gt;
&lt;TD colSpan=2&gt;&lt;IMG height=25 src="http://barracudamvc.org/Barracuda/images/tr.gif" width=13&gt;&lt;/TD&gt;&lt;/TR&gt;
&lt;TR&gt;
&lt;TD bgColor=#000080&gt;&lt;IMG height=2 src="http://barracudamvc.org/Barracuda/images/spacer.gif" width=2&gt;&lt;/TD&gt;
&lt;TD&gt;&lt;IMG height=11 src="http://barracudamvc.org/Barracuda/images/spacer.gif" width=11&gt;&lt;/TD&gt;
&lt;TD vAlign=top width=576 height=65&gt;
&lt;TABLE cellSpacing=0 cellPadding=0 width="100%" border=0&gt;
&lt;TBODY&gt;
&lt;TR&gt;
&lt;TD width="100%"&gt;&lt;IMG height=140 alt="barracuda.gif (11357 bytes)" src="http://barracudamvc.org/Barracuda/images/barracuda.gif" width=145 align=right&gt;The purpose of this document is to provide a detailed analysis of both Barracuda and Struts. We focus on summarizing each architecture, and then performing a comparison / contrast on key issues. 
&lt;OL&gt;
&lt;LI&gt;&lt;A href="http://barracudamvc.org/Barracuda/docs/barracuda_vs_struts.html#Development_Landscape"&gt;&lt;FONT color=#002c99&gt;Development Landscape&lt;/FONT&gt;&lt;/A&gt; 
&lt;LI&gt;&lt;A href="http://barracudamvc.org/Barracuda/docs/barracuda_vs_struts.html#Framework_Summaries"&gt;&lt;FONT color=#002c99&gt;Framework Summaries&lt;/FONT&gt;&lt;/A&gt; 
&lt;OL&gt;
&lt;LI&gt;&lt;A href="http://barracudamvc.org/Barracuda/docs/barracuda_vs_struts.html#Barracuda"&gt;&lt;FONT color=#002c99&gt;Barracuda&lt;/FONT&gt;&lt;/A&gt; 
&lt;OL&gt;
&lt;LI&gt;&lt;A href="http://barracudamvc.org/Barracuda/docs/barracuda_vs_struts.html#Client_Capabilities"&gt;&lt;FONT color=#002c99&gt;Client Capabilities&lt;/FONT&gt;&lt;/A&gt; 
&lt;LI&gt;&lt;A href="http://barracudamvc.org/Barracuda/docs/barracuda_vs_struts.html#Event_Model"&gt;&lt;FONT color=#002c99&gt;Event Model&lt;/FONT&gt;&lt;/A&gt; 
&lt;LI&gt;&lt;A href="http://barracudamvc.org/Barracuda/docs/barracuda_vs_struts.html#Form_Mapping"&gt;&lt;FONT color=#002c99&gt;Form Mapping &amp;amp; Validation&lt;/FONT&gt;&lt;/A&gt; 
&lt;LI&gt;&lt;A href="http://barracudamvc.org/Barracuda/docs/barracuda_vs_struts.html#XMLC"&gt;&lt;FONT color=#002c99&gt;XMLC&lt;/FONT&gt;&lt;/A&gt; 
&lt;LI&gt;&lt;A href="http://barracudamvc.org/Barracuda/docs/barracuda_vs_struts.html#Localization"&gt;&lt;FONT color=#002c99&gt;Localization&lt;/FONT&gt;&lt;/A&gt; 
&lt;LI&gt;&lt;A href="http://barracudamvc.org/Barracuda/docs/barracuda_vs_struts.html#Component_Model"&gt;&lt;FONT color=#002c99&gt;Component Model&lt;/FONT&gt;&lt;/A&gt; &lt;/LI&gt;&lt;/OL&gt;
&lt;LI&gt;&lt;A href="http://barracudamvc.org/Barracuda/docs/barracuda_vs_struts.html#Struts"&gt;&lt;FONT color=#002c99&gt;Struts&lt;/FONT&gt;&lt;/A&gt; 
&lt;OL&gt;
&lt;LI&gt;&lt;A href="http://barracudamvc.org/Barracuda/docs/barracuda_vs_struts.html#Struts_Controller"&gt;&lt;FONT color=#002c99&gt;Controller&lt;/FONT&gt;&lt;/A&gt; 
&lt;LI&gt;&lt;A href="http://barracudamvc.org/Barracuda/docs/barracuda_vs_struts.html#Struts_Model"&gt;&lt;FONT color=#002c99&gt;Model&lt;/FONT&gt;&lt;/A&gt; 
&lt;LI&gt;&lt;A href="http://barracudamvc.org/Barracuda/docs/barracuda_vs_struts.html#Struts_View"&gt;&lt;FONT color=#002c99&gt;View&lt;/FONT&gt;&lt;/A&gt; 
&lt;LI&gt;&lt;A href="http://barracudamvc.org/Barracuda/docs/barracuda_vs_struts.html#Stuts_Utilities"&gt;&lt;FONT color=#002c99&gt;Utilities&lt;/FONT&gt;&lt;/A&gt; 
&lt;LI&gt;&lt;A href="http://barracudamvc.org/Barracuda/docs/barracuda_vs_struts.html#Struts_Future"&gt;&lt;FONT color=#002c99&gt;Future Directions&lt;/FONT&gt;&lt;/A&gt; &lt;/LI&gt;&lt;/OL&gt;&lt;/LI&gt;&lt;/OL&gt;
&lt;LI&gt;&lt;A href="http://barracudamvc.org/Barracuda/docs/barracuda_vs_struts.html#Comparison-Contrast"&gt;&lt;FONT color=#002c99&gt;Comparison / Contrast&lt;/FONT&gt;&lt;/A&gt; 
&lt;OL&gt;
&lt;LI&gt;&lt;A href="http://barracudamvc.org/Barracuda/docs/barracuda_vs_struts.html#CC_UI"&gt;&lt;FONT color=#002c99&gt;UI Issues&lt;/FONT&gt;&lt;/A&gt; 
&lt;OL&gt;
&lt;LI&gt;&lt;A href="http://barracudamvc.org/Barracuda/docs/barracuda_vs_struts.html#CC_UI_Pres_Logic_Separation"&gt;&lt;FONT color=#002c99&gt;Separating Presentation from Programming Logic&lt;/FONT&gt;&lt;/A&gt; 
&lt;LI&gt;&lt;A href="http://barracudamvc.org/Barracuda/docs/barracuda_vs_struts.html#CC_UI_Page_Design"&gt;&lt;FONT color=#002c99&gt;Page Design&lt;/FONT&gt;&lt;/A&gt; 
&lt;LI&gt;&lt;A href="http://barracudamvc.org/Barracuda/docs/barracuda_vs_struts.html#CC_UI_Taglibs"&gt;&lt;FONT color=#002c99&gt;Taglibs&lt;/FONT&gt;&lt;/A&gt; 
&lt;LI&gt;&lt;A href="http://barracudamvc.org/Barracuda/docs/barracuda_vs_struts.html#CC_UI_Layout"&gt;&lt;FONT color=#002c99&gt;UI Layout&lt;/FONT&gt;&lt;/A&gt; 
&lt;LI&gt;&lt;A href="http://barracudamvc.org/Barracuda/docs/barracuda_vs_struts.html#CC_UI_Localization"&gt;&lt;FONT color=#002c99&gt;Localization&lt;/FONT&gt;&lt;/A&gt; 
&lt;LI&gt;&lt;A href="http://barracudamvc.org/Barracuda/docs/barracuda_vs_struts.html#CC_UI_Multiple_Clients"&gt;&lt;FONT color=#002c99&gt;Support for multiple Client Types&lt;/FONT&gt;&lt;/A&gt; 
&lt;LI&gt;&lt;A href="http://barracudamvc.org/Barracuda/docs/barracuda_vs_struts.html#CC_UI_Multiple_Skins"&gt;&lt;FONT color=#002c99&gt;Support for multiple Client Skins&lt;/FONT&gt;&lt;/A&gt; 
&lt;LI&gt;&lt;A href="http://barracudamvc.org/Barracuda/docs/barracuda_vs_struts.html#CC_UI_Client_Capabilities"&gt;&lt;FONT color=#002c99&gt;Client Capabilities&lt;/FONT&gt;&lt;/A&gt; 
&lt;LI&gt;&lt;A href="http://barracudamvc.org/Barracuda/docs/barracuda_vs_struts.html#CC_UI_Client_Accessibility"&gt;&lt;FONT color=#002c99&gt;Client Accessibility&lt;/FONT&gt;&lt;/A&gt; &lt;/LI&gt;&lt;/OL&gt;
&lt;LI&gt;&lt;A href="http://barracudamvc.org/Barracuda/docs/barracuda_vs_struts.html#CC_Flow"&gt;&lt;FONT color=#002c99&gt;Flow Control Issues&lt;/FONT&gt;&lt;/A&gt; 
&lt;OL&gt;
&lt;LI&gt;&lt;A href="http://barracudamvc.org/Barracuda/docs/barracuda_vs_struts.html#CC_Flow_Event_Handling"&gt;&lt;FONT color=#002c99&gt;Event Handling&lt;/FONT&gt;&lt;/A&gt; 
&lt;LI&gt;&lt;A href="http://barracudamvc.org/Barracuda/docs/barracuda_vs_struts.html#CC_Flow_MVC"&gt;&lt;FONT color=#002c99&gt;MVC / Model 2&lt;/FONT&gt;&lt;/A&gt; 
&lt;LI&gt;&lt;A href="http://barracudamvc.org/Barracuda/docs/barracuda_vs_struts.html#CC_Flow_Workflow"&gt;&lt;FONT color=#002c99&gt;Workflow&lt;/FONT&gt;&lt;/A&gt; &lt;/LI&gt;&lt;/OL&gt;
&lt;LI&gt;&lt;A href="http://barracudamvc.org/Barracuda/docs/barracuda_vs_struts.html#CC_SS"&gt;&lt;FONT color=#002c99&gt;Server Side Issues&lt;/FONT&gt;&lt;/A&gt; 
&lt;OL&gt;
&lt;LI&gt;&lt;A href="http://barracudamvc.org/Barracuda/docs/barracuda_vs_struts.html#CC_SS_Form_Mapping"&gt;&lt;FONT color=#002c99&gt;Form Mapping &amp;amp; Validation&lt;/FONT&gt;&lt;/A&gt; 
&lt;LI&gt;&lt;A href="http://barracudamvc.org/Barracuda/docs/barracuda_vs_struts.html#CC_SS_Error_Handling"&gt;&lt;FONT color=#002c99&gt;Error Handling&lt;/FONT&gt;&lt;/A&gt; 
&lt;LI&gt;&lt;A href="http://barracudamvc.org/Barracuda/docs/barracuda_vs_struts.html#CC_SS_Component_Models"&gt;&lt;FONT color=#002c99&gt;Component Models&lt;/FONT&gt;&lt;/A&gt; 
&lt;LI&gt;&lt;A href="http://barracudamvc.org/Barracuda/docs/barracuda_vs_struts.html#CC_SS_Component_Reuse"&gt;&lt;FONT color=#002c99&gt;Component Reuse&lt;/FONT&gt;&lt;/A&gt; &lt;/LI&gt;&lt;/OL&gt;
&lt;LI&gt;&lt;A href="http://barracudamvc.org/Barracuda/docs/barracuda_vs_struts.html#CC_Scalability"&gt;&lt;FONT color=#002c99&gt;Scalability&lt;/FONT&gt;&lt;/A&gt; 
&lt;OL&gt;
&lt;LI&gt;&lt;A href="http://barracudamvc.org/Barracuda/docs/barracuda_vs_struts.html#CC_Scalability_Throughput"&gt;&lt;FONT color=#002c99&gt;Throughput&lt;/FONT&gt;&lt;/A&gt; 
&lt;LI&gt;&lt;A href="http://barracudamvc.org/Barracuda/docs/barracuda_vs_struts.html#CC_Scalability_Volume"&gt;&lt;FONT color=#002c99&gt;Volume&lt;/FONT&gt;&lt;/A&gt; &lt;/LI&gt;&lt;/OL&gt;
&lt;LI&gt;&lt;A href="http://barracudamvc.org/Barracuda/docs/barracuda_vs_struts.html#CC_Tools"&gt;&lt;FONT color=#002c99&gt;Tools Integration&lt;/FONT&gt;&lt;/A&gt; 
&lt;OL&gt;
&lt;LI&gt;&lt;A href="http://barracudamvc.org/Barracuda/docs/barracuda_vs_struts.html#CC_Tools_Page_Tools"&gt;&lt;FONT color=#002c99&gt;Page Tools&lt;/FONT&gt;&lt;/A&gt; 
&lt;LI&gt;&lt;A href="http://barracudamvc.org/Barracuda/docs/barracuda_vs_struts.html#CC_Tools_IDEs"&gt;&lt;FONT color=#002c99&gt;IDEs&lt;/FONT&gt;&lt;/A&gt; &lt;/LI&gt;&lt;/OL&gt;&lt;/LI&gt;&lt;/OL&gt;&lt;/LI&gt;&lt;/OL&gt;
&lt;HR SIZE=1&gt;

&lt;P&gt;&lt;STRONG&gt;&lt;A name=Development_Landscape&gt;Development Landscape&lt;/A&gt;&lt;/STRONG&gt; - When it comes to developing webapps, it seems difficult to overstate the level of diversity found in various approaches. Upon closer inspection, however, we can identify certain elements of polarization within the current development landscape. 
&lt;UL&gt;
&lt;LI&gt;
&lt;P align=left&gt;&lt;U&gt;&lt;STRONG&gt;Developer Types&lt;/STRONG&gt;&lt;/U&gt; - there seem to be two distinct classes of developers creating web applications today: &lt;/P&gt;
&lt;OL&gt;
&lt;LI&gt;
&lt;P align=left&gt;&lt;STRONG&gt;Page Authors&lt;/STRONG&gt; - tend to view the webapp space primarily from a page based perspective. These folks are by far the most numerous, tend to gravitate towards technologies like JSP, ASP, PHP, Cold Fusion, and various other template based approaches. Often are familiar with scripting languages like JavaScript and VBScript.&lt;/P&gt;
&lt;LI&gt;
&lt;P align=left&gt;&lt;STRONG&gt;Java Developers&lt;/STRONG&gt; - tend to view the webapp space more from an application centric perspective. These folks are more likely to be comfortable with coding in a strongly typed OO language like Java, C++ or SmallTalk, and are often building webapps using Servlet technologies.&lt;/P&gt;&lt;/LI&gt;&lt;/OL&gt;
&lt;LI&gt;
&lt;P align=left&gt;&lt;U&gt;&lt;STRONG&gt;Development Tools&lt;/STRONG&gt;&lt;/U&gt; - along similar lines, we can see two distinct genres of development tools that correspond closely to developer types given above:&lt;/P&gt;
&lt;OL&gt;
&lt;LI&gt;
&lt;P align=left&gt;&lt;STRONG&gt;Page Based Tools&lt;/STRONG&gt; - these often correspond with visual page editors like DreamWeaver, UltraDev, and FrontPage. &lt;/P&gt;
&lt;LI&gt;
&lt;P align=left&gt;&lt;STRONG&gt;Traditional IDEs&lt;/STRONG&gt; - these would be more along the lines of applications like JBuilder, NetBeans/Forte, VisualAge, and perhaps VisualCafe.&lt;/P&gt;&lt;/LI&gt;&lt;/OL&gt;&lt;/LI&gt;&lt;/UL&gt;
&lt;P align=left&gt;While these are obvious generalizations (and there is undoubtedly overlap!), it is valuable to delineate this segmentation, as many web frameworks will gravitate towards one or the other ends of the spectrum.&lt;/P&gt;
&lt;P align=left&gt;Interestingly, none of the development tools that exist today really make it &lt;EM&gt;easy&lt;/EM&gt; to develop webapps (at least not to the extent that a tool like VB made it possible for Corporate Developers to easily build applications without a lot of specialized programming knowledge). Ultimately, we feel these tools are lacking primarily because a suitable presentation framework infrastructure -- capable of supporting the challenges of the HTTP Req-Resp paradigm, with its necessary separation of presentation and business logic -- has not yet emerged. Such a framework will be critical if we ever hope to see tools that unify the designer roles and developer roles and allow the rapid assembly of web application and web services from reusable components.&lt;/P&gt;
&lt;HR SIZE=1&gt;

&lt;P&gt;&lt;A name=Framework_Summaries&gt;&lt;STRONG&gt;Framework Summaries&lt;/STRONG&gt;&lt;/A&gt; - We want to start by taking a high level look at how each of the various frameworks approaches the problem domain: making it easier to build web apps. We begin by looking at Barracuda (since we know that best after all ;-) and then look at some other leading efforts. 
&lt;OL&gt;
&lt;LI&gt;
&lt;P align=left&gt;&lt;STRONG&gt;&lt;A href="http://barracudamvc.org/" name=Barracuda&gt;&lt;FONT color=#002c99&gt;Barracuda&lt;/FONT&gt;&lt;/A&gt;&lt;/STRONG&gt; - The Barracuda Presentation framework is built as a series of layers that depend on the Servlet 2.2+ API, each of which can be used independently of one another. In terms of audience, Barracuda definitely aims at the Java Developer end of the spectrum (with the idea that tools integration will ultimately make the approach more accessible to Page Author types).&lt;/P&gt;
&lt;P align=left&gt;At the highest level, the Barracuda architecture can be summarized by the following diagram:&lt;/P&gt;
&lt;P&gt;&lt;IMG height=227 alt="arch_overview.gif (20966 bytes)" src="http://barracudamvc.org/Barracuda/images/arch_overview.gif" width=434&gt;&lt;/P&gt;
&lt;P align=left&gt;The key features of Barracuda are summarized here:&lt;/P&gt;
&lt;OL&gt;
&lt;LI&gt;&lt;STRONG&gt;Client Capabilities&lt;/STRONG&gt; - Automatically identifies client capabilities (browser type, target locale, etc). 
&lt;LI&gt;&lt;STRONG&gt;Event Model&lt;/STRONG&gt; - Maps client requests to first class event objects; dispatches events to all interested listeners; guarantees that an HTTP Response is generated. 
&lt;LI&gt;&lt;STRONG&gt;Form Mapping &amp;amp; Validation&lt;/STRONG&gt; - Converts HTTP Form parameters into first class Java objects and provides a powerful validation mechanism to verify them. 
&lt;LI&gt;&lt;STRONG&gt;XMLC&lt;/STRONG&gt; - Compiles HTML, WML, and XML documents into DOM template objects that can be manipulated programmatically. 
&lt;LI&gt;&lt;STRONG&gt;Localization&lt;/STRONG&gt; - Automatically creates localized versions of the DOM templates for additional locales. These templates can be loaded based on a target client locale. 
&lt;LI&gt;&lt;STRONG&gt;Component Model&lt;/STRONG&gt; - Uses familiar UI Widgets with strongly typed Swing-style MVC interfaces to dynamically populate the DOM templates with data. the DOM can then be rendered and returned to the client browser. &lt;/LI&gt;&lt;/OL&gt;
&lt;P align=left&gt;A detailed explanation of these areas follows:&lt;/P&gt;
&lt;OL&gt;
&lt;LI&gt;
&lt;P align=left&gt;&lt;STRONG&gt;&lt;A name=Client_Capabilities&gt;Client Capabilities&lt;/A&gt; &lt;/STRONG&gt;- Barracuda begins by identifying the client's capabilities. In particular, it can&amp;nbsp; determine: &lt;/P&gt;
&lt;UL&gt;
&lt;LI&gt;&lt;STRONG&gt;client type&lt;/STRONG&gt; -- what kind of client are we dealing with (NN, IE, etc) as well as the specific version of the client 
&lt;LI&gt;&lt;STRONG&gt;client scripting capabilities&lt;/STRONG&gt; -- what kind of scripting is supported (Javascript, VBScript, WMLScript, or None) along with the specific version information 
&lt;LI&gt;&lt;STRONG&gt;target output format&lt;/STRONG&gt; -- what kind of output the client expects (HTML, WML, XML, etc) as well as the specific version of markup supported 
&lt;LI&gt;&lt;STRONG&gt;target client locale&lt;/STRONG&gt; -- the client locale information &lt;/LI&gt;&lt;/UL&gt;
&lt;P&gt;This information is available throughout the entire request-response cycle, making it easy to perform custom processing based on a client specifics.&lt;/P&gt;
&lt;LI&gt;
&lt;P align=left&gt;&lt;STRONG&gt;&lt;A name=Event_Model&gt;Event Model&lt;/A&gt;&lt;/STRONG&gt; - The Barracuda event model is all about routing -- it's responsible for turning HTTP Requests into first class event objects, dispatching the events to interested parties, and then making sure that an HTTP Response was generated. There are a number of specific features:&lt;/P&gt;
&lt;UL&gt;
&lt;LI&gt;makes it easy to implement &lt;STRONG&gt;Model 2&lt;/STRONG&gt; style flow control by utilizing a 2-phase dispatch loop in which all &lt;STRONG&gt;Request (Control) Events&lt;/STRONG&gt; are processed first, followed by all &lt;STRONG&gt;Response (View) Events&lt;/STRONG&gt;. 
&lt;LI&gt;allows for true event driven programming on the server since events are &lt;STRONG&gt;first class Java objects&lt;/STRONG&gt; (not just strings or method names) and any event can have &lt;STRONG&gt;multiple listeners&lt;/STRONG&gt; 
&lt;LI&gt;event handlers can be &lt;STRONG&gt;implemented using inner classes&lt;/STRONG&gt;, just like in Swing 
&lt;LI&gt;&lt;STRONG&gt;integrates with the component model&lt;/STRONG&gt;, meaning you can add listeners to components and your server-side event handler code will automatically get invoked when an action occurs on the client 
&lt;LI&gt;events are &lt;STRONG&gt;hierarchical in nature&lt;/STRONG&gt;, making it very easy to make an application &lt;STRONG&gt;secure&lt;/STRONG&gt; (by controlling what events can be fired without needing to modify the actual event handler code) and &lt;STRONG&gt;robust&lt;/STRONG&gt; (by ensuring that a response will always be generated, even if the developer forgets to handle a view event) 
&lt;LI&gt;the model is &lt;STRONG&gt;fundamentally scalable&lt;/STRONG&gt; -- event handler instances are &lt;STRONG&gt;lightweight&lt;/STRONG&gt; and &lt;STRONG&gt;short-lived&lt;/STRONG&gt;&amp;nbsp; (lasting only for the duration of a req-resp cycle) and event dispatching is &lt;STRONG&gt;fast&lt;/STRONG&gt; (no reflection / introspection) &lt;/LI&gt;&lt;/UL&gt;
&lt;P&gt;As a final note, the Barracuda Event model is based on interfaces, making it &lt;STRONG&gt;fully pluggable&lt;/STRONG&gt; (you could easily substitute your own event dispatching mechanism if need be). In addition, while the model is tuned for the HTTP Req-Resp paradigm, &lt;STRONG&gt;it could also be integrated with other non-response based protocols&lt;/STRONG&gt; (ie. SMTP, JMS, a 3rd party scheduling system, etc).&lt;/P&gt;
&lt;LI&gt;
&lt;P align=left&gt;&lt;STRONG&gt;&lt;A name=Form_Mapping&gt;Form Mapping&lt;/A&gt; &amp;amp; Validation&lt;/STRONG&gt; - Once the Event Model has routed control to the proper location, it is often necessary to examine a client's input parameters before actually generating a response. This is where Barracuda's Form Mapping &amp;amp; Validation layer comes into play:&lt;/P&gt;
&lt;OL&gt;
&lt;LI&gt;easily &lt;STRONG&gt;map HTTP Form parameters into first class Java objects&lt;/STRONG&gt; based on key name and data type (String, Boolean, Integer, Date, Long, Short, Double, Float) 
&lt;LI&gt;provide &lt;STRONG&gt;default values&lt;/STRONG&gt; if an expected parameter is not present 
&lt;LI&gt;provide a number of &lt;STRONG&gt;prebuilt validators&lt;/STRONG&gt; (NotNull, ValidType, Equals, MaxLength, MinLength, Range, Digit) to handle common validation tasks in a reusable fashion 
&lt;LI&gt;support the the notion of &lt;STRONG&gt;custom validators&lt;/STRONG&gt; to express specific business logic validation requirements 
&lt;LI&gt;allow for &lt;STRONG&gt;validator aggregation&lt;/STRONG&gt;, by which any number of simple validators can be used as building blocks for more complex validation behavior 
&lt;LI&gt;support for&amp;nbsp; &lt;STRONG&gt;nestable validation exceptions&lt;/STRONG&gt;, making it possible to catch either the first exception or all exceptions on a collection of data &lt;/LI&gt;&lt;/OL&gt;
&lt;P&gt;These features make it easy to get data back from the client in a form that is more easily handled on the server.&lt;/P&gt;
&lt;LI&gt;
&lt;P align=left&gt;&lt;A name=XMLC&gt;&lt;STRONG&gt;XMLC&lt;/STRONG&gt;&lt;/A&gt; - Once we have converted data that came from the client into something more useful than raw String data, we usually need to respond in some fashion (ie. the &lt;STRONG&gt;Do-Something-on-the-Server phase&lt;/STRONG&gt;). If we are following the Model 2 pattern, this might involve updating some kind of "Model" via JDBC, RMI, EJB, etc.&lt;/P&gt;
&lt;P align=left&gt;Barracuda offers no help yet imposes no restrictions on what you do in this stage. Instead, it waits for the &lt;STRONG&gt;Render-a-Response phase&lt;/STRONG&gt; that inevitably follows. This is the point in which we finally generate a page (or "View") in response to the client's HTTP Request. Barracuda has a lot to offer in this area, and it all starts with a tool called XMLC.&lt;/P&gt;
&lt;P&gt;XMLC is a tool that generates &lt;STRONG&gt;DOM based template objects&lt;/STRONG&gt; from &lt;STRONG&gt;HTML&lt;/STRONG&gt; and &lt;STRONG&gt;XML&lt;/STRONG&gt; &lt;STRONG&gt;documents&lt;/STRONG&gt;. Unlike traditional template approaches (JSP, WebMacro, Velocity, etc.) which require you to embed programming logic in the UI markup (aka "&lt;STRONG&gt;Pull-MVC&lt;/STRONG&gt;"), XMLC allows the developer to manipulate a template programmatically (aka "&lt;STRONG&gt;Push-MVC&lt;/STRONG&gt;"). There are a number of distinct advantages: 
&lt;UL&gt;
&lt;LI&gt;provides excellent &lt;STRONG&gt;code-content separation&lt;/STRONG&gt; -- the presentation markup is physically decoupled from all programming logic used to manipulate a page (each is stored in separate files) 
&lt;LI&gt;this paradigm &lt;STRONG&gt;mirrors the dual roles (Designer vs. Developer)&lt;/STRONG&gt; prevalent in real-world webapp development and benefits both parties in the dev process 
&lt;LI&gt;for the designer... 
&lt;UL&gt;
&lt;LI&gt;guarantees the template documents will always be &lt;STRONG&gt;valid, well-formed markup &lt;/STRONG&gt;
&lt;LI&gt;this makes it much easier for a designer to create and maintain the documents using &lt;STRONG&gt;standard interactive design tools&lt;/STRONG&gt; 
&lt;LI&gt;furthermore, a collection of template source documents can continue to function as a &lt;STRONG&gt;working mockup &lt;/STRONG&gt;of the application 
&lt;LI&gt;in addition, the &lt;STRONG&gt;designer can make changes&lt;/STRONG&gt; to the presentation layout without involving the developer &lt;/LI&gt;&lt;/UL&gt;
&lt;LI&gt;for the developer... 
&lt;UL&gt;
&lt;LI&gt;the &lt;STRONG&gt;developer can make changes&lt;/STRONG&gt; to the business logic layers without involving the designer or impacting the presentation layout 
&lt;LI&gt;the developer can create &lt;STRONG&gt;more portable code&lt;/STRONG&gt; by coding against well defined industry standard DOM interfaces (ie. w3c.org) 
&lt;LI&gt;this approach supports &lt;STRONG&gt;multiple document types&lt;/STRONG&gt; (HTML, WML, XML, etc...anything that can be read as a DOM) 
&lt;LI&gt;&lt;STRONG&gt;compile time parsing&lt;/STRONG&gt; of HTML/XML document offers a significant performance benefit for complex pages. 
&lt;LI&gt;XMLC's &lt;STRONG&gt;Lazy-DOM support&lt;/STRONG&gt; further improves performance by only creating DOM nodes for those portions of the template which are actually modified dynamically &lt;/LI&gt;&lt;/UL&gt;
&lt;LI&gt;clean separation of roles promotes &lt;STRONG&gt;full parallel development&lt;/STRONG&gt; -- the designer can focus on design and the developer can focus on programming logic. Neither has to worry about interfering with the other 
&lt;LI&gt;&lt;STRONG&gt;enforces good development practices&lt;/STRONG&gt; -- developers cannot create KLOCs of unmaintainable presentation code like they can with JSP; corporate developers like this enforcement (Merck and GE are examples of corporate IT shops that have selected XMLC for the natural policy of markup/Java separation) 
&lt;LI&gt;offers &lt;STRONG&gt;advanced compilation features&lt;/STRONG&gt; 
&lt;UL&gt;
&lt;LI&gt;supports runtime auto compilation if markup changes in original doc are detected. 
&lt;LI&gt;supports runtime classloading if new DOM class template is detected. 
&lt;LI&gt;factory methods make it possible to implement one DOM class template interface with multiple, dynamically selected implementations. &lt;/LI&gt;&lt;/UL&gt;&lt;/LI&gt;&lt;/UL&gt;
&lt;P&gt;These features combine to make for a very powerful templating mechanism that is not subject to many of the limitations found in more traditional templating approaches.&lt;/P&gt;
&lt;LI&gt;
&lt;P align=left&gt;&lt;STRONG&gt;&lt;A name=Localization&gt;Localization&lt;/A&gt;&lt;/STRONG&gt; - Barracuda leverages the strengths of XMLC to provide a unique and innovative solution for Localization. Typically, when one wishes to localize a template driven application, one either creates localized versions of all the templates (efficiency at the expense of maintainability), or one dynamically localizes both text and data in a page for every given request (more maintainable, but at the expense of efficiency).&lt;/P&gt;
&lt;P align=left&gt;Barracuda looks for a better solution, one that provides the best of both worlds -- we need something that is efficient (ie. we'd only like to localize static text once for each template) and yet at the same time maintainable (ie. we don't want to have to manage separate localized versions of each template). The solution is elegant.&lt;/P&gt;
&lt;UL&gt;
&lt;LI&gt;Barracuda uses the Ant build system, allowing us to provide a &lt;STRONG&gt;custom XMLC taskdef&lt;/STRONG&gt; that not only compiles the *ML template (ie. Foo.html) to an XMLC object (FooHTML.class), but also looks for the presence of a master properties files associated with that template (ie. Foo.properties) 
&lt;LI&gt;the &lt;STRONG&gt;master properties file&lt;/STRONG&gt; can be used to identify the portions of the template that map to "static-but-localizable" text 
&lt;LI&gt;the taskdef then looks for &lt;STRONG&gt;matching localized properties files&lt;/STRONG&gt; that follow the locale naming convention (ie. Foo_es.properties). If found, additional templates (ie. Foo_es.html) will be created from the master template, with the localized text substituted in. These too will then be compiled to XMLC objects (ie. FooHTML_es.class) 
&lt;LI&gt;Barracuda provides a &lt;STRONG&gt;custom DOM loader&lt;/STRONG&gt; which can load an XMLC DOM template based on a target locale (ie. the programmer specifies "FooHTML.class" for a target locale of "es" and receives a reference to "FooHTML_es.class" 
&lt;LI&gt;the DOM loader works on the &lt;STRONG&gt;same principle as Java's ResourceBundle&lt;/STRONG&gt; class, so if a particular template is not available (ie. language "es", country "CL"), the next closest match will be used. &lt;/LI&gt;&lt;/UL&gt;
&lt;P align=left&gt;This approach makes it very easy for the programmer to select a localized DOM template for use in the rendering process without having to jump through any special hoops.&lt;/P&gt;
&lt;LI&gt;
&lt;P align=left&gt;&lt;A name=Component_Model&gt;&lt;STRONG&gt;Component Model&lt;/STRONG&gt; &lt;/A&gt;- Once the developer has loaded the appropriate "View" template, the next step is to dynamically populate the DOM structure with data. Unfortunately the DOM interfaces are rather low-level and tedious to program against (especially for complex structures like Lists and Tables). This is where the Barracuda Component Model comes into play.&lt;/P&gt;
&lt;P align=left&gt;The basic idea behind the component model is that you can create a hierarchy of components which are each bound to various portions of the DOM hierarchy. Now rather than manipulating the DOM directly, we can put the data in the components and then render them. The components are intelligent enough to to render the data properly into the DOM structure. There are a number of specific features:&lt;/P&gt;
&lt;UL&gt;
&lt;LI&gt;
&lt;P align=left&gt;at the most basic level, Barracuda components can be viewed as UI Widgets that are similar in many ways to what you find in Swing:&lt;/P&gt;
&lt;UL&gt;
&lt;LI&gt;any component may &lt;STRONG&gt;contain other components&lt;/STRONG&gt; 
&lt;LI&gt;the primary responsibility of components is to &lt;STRONG&gt;render data&lt;/STRONG&gt; into the portion of the DOM to which they are bound, and to &lt;STRONG&gt;render all child components&lt;/STRONG&gt; 
&lt;LI&gt;there are a number of basic components (&lt;STRONG&gt;BInput&lt;/STRONG&gt;, &lt;STRONG&gt;BToggleButton&lt;/STRONG&gt;, &lt;STRONG&gt;BAction&lt;/STRONG&gt;, &lt;STRONG&gt;BLink&lt;/STRONG&gt;, &lt;STRONG&gt;BText&lt;/STRONG&gt;, etc) that all extend from a base &lt;STRONG&gt;BComponent&lt;/STRONG&gt; 
&lt;LI&gt;there are several more advanced components (&lt;STRONG&gt;BList&lt;/STRONG&gt;, &lt;STRONG&gt;BSelect&lt;/STRONG&gt;, &lt;STRONG&gt;BTable&lt;/STRONG&gt;, and &lt;STRONG&gt;BTemplate&lt;/STRONG&gt;) that provide &lt;STRONG&gt;strongly typed MVC interfaces&lt;/STRONG&gt;, just like you'd find in &lt;STRONG&gt;Swing&lt;/STRONG&gt; 
&lt;LI&gt;all Barracuda component &lt;STRONG&gt;models may return multiple data types&lt;/STRONG&gt; -- &lt;STRONG&gt;Strings&lt;/STRONG&gt;, &lt;STRONG&gt;DOM Nodes&lt;/STRONG&gt;, or other &lt;STRONG&gt;BComponents&lt;/STRONG&gt;. This is strategic for supporting component aggregation. 
&lt;LI&gt;there is &lt;STRONG&gt;no framework imposed lifecycle&lt;/STRONG&gt; -- you can keep components around for as long or as short a time as makes sense for your domain. In other words, you can create/destroy them repeatedly for every render cycle, or you can cache them on a per-session basis. The developer is not locked into any one approach. 
&lt;LI&gt;similarly, there are &lt;STRONG&gt;no imposed state restrictions&lt;/STRONG&gt; -- the framework does not force you to take any particular approach to manage component state. You can persist component state where you wish when/if you need to do so. 
&lt;LI&gt;
&lt;P align=left&gt;some Barracuda components offer &lt;STRONG&gt;event model integration&lt;/STRONG&gt; -- by adding an event handler the server can be automatically notified when a client gesture occurs. For the developer the process appears seamless, just like in Swing.&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;
&lt;LI&gt;
&lt;P align=left&gt;Barracuda components are also different from Swing components in many ways:&lt;/P&gt;
&lt;UL&gt;
&lt;LI&gt;they are &lt;STRONG&gt;modeled on the data rather than the UI functionality&lt;/STRONG&gt; associated with that data (ie. instead of having multiple components like JLabel and JTextArea, there is one BText component which can render text into many different types of DOM nodes. Similarly, there is one BList component that can render list data into many different markup structures) 
&lt;LI&gt;in addition to having well defined Model interfaces, all Barracuda components must also be &lt;STRONG&gt;bound to at least one View &lt;/STRONG&gt;on the DOM. 
&lt;LI&gt;Barracuda components are &lt;STRONG&gt;more concerned with data than layout&lt;/STRONG&gt;, since layout information is typically encapsulated in the DOM template 
&lt;LI&gt;as such, they are &lt;STRONG&gt;extremely lightweight&lt;/STRONG&gt; (because they don't have much information to keep track of) 
&lt;LI&gt;they use &lt;STRONG&gt;pluggable renderers&lt;/STRONG&gt; to render markup appropriate to the DOM template type (ie. HTML, WML, XML, etc.) 
&lt;LI&gt;this allows for &lt;STRONG&gt;highly intelligent rendering&lt;/STRONG&gt;; we can take into account the type of node to which a component is bound and render the data accordingly 
&lt;LI&gt;
&lt;P align=left&gt;Barracuda components also have to &lt;STRONG&gt;address component aggregation/reuse differently&lt;/STRONG&gt;, since the code-content separation means we need more than just class files to create a reusable component -- we need an&amp;nbsp; accompanying DOM template, plus static resources that might be associated with it (.gif files, etc).&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;
&lt;LI&gt;
&lt;P align=left&gt;While most of the Barracuda components extend the "Push-MVC" model necessitated by an XMLC based approach, the &lt;STRONG&gt;BTemplate component enables "Pull-MVC"&lt;/STRONG&gt; as well.&lt;/P&gt;
&lt;UL&gt;
&lt;LI&gt;the BTemplate component parses the template looking for "directives" (stored either in the template or in a separate properties file) 
&lt;LI&gt;these directives are then mapped to data in a manner similar to that of taglibs (except of course that the model can return more than just String data!) 
&lt;LI&gt;this approach provides better designer-developer decoupling, while still leaving the developer tremendous freedom in terms of how to provide the requested data 
&lt;LI&gt;this effectively "componentizes" the template engine approach so its just another tool in the developers bag of tricks -- freely available when necessary, yet conveniently avoidable when not. In other words, this doesn't lock you into using a template engine for an entire page/app the way most template approaches do...you can use it where it makes sense. &lt;/LI&gt;&lt;/UL&gt;&lt;/LI&gt;&lt;/UL&gt;
&lt;P align=left&gt;The result of all this is a component framework that is inspired by Swing yet fully accounts for the intricacies of code-content separation and the HTTP Req-Resp paradigm. In addition, it supports a full spectrum of server side development methodologies, ranging from "Push-MVC" to "Pull-MVC".&lt;/P&gt;&lt;/LI&gt;&lt;/OL&gt;
&lt;LI&gt;
&lt;P align=left&gt;&lt;STRONG&gt;&lt;A href="http://jakarta.apache.org/struts" name=Struts&gt;&lt;FONT color=#002c99&gt;Struts&lt;/FONT&gt;&lt;/A&gt;&lt;/STRONG&gt; - Unlike Barracuda, Struts is aimed primarily at the Page Author types. This is not to say that Struts does not require Java coding--after all, you still need developer types to implement Tag libraries and write Controller code. Rather, it aims to suggest that it is Page Authors who will get the most mileage from the framework; if you do not adopt a JSP strategy for rendering views, the value of Struts is greatly diminished. &lt;/P&gt;
&lt;P align=left&gt;Given this focus, Struts tries to streamline existing page based approaches to webapp development. It values simplicity, and can make a lot of design decisions for you automatically. At the highest level, the Struts architecture looks something like this:&lt;/P&gt;
&lt;P&gt;&lt;IMG height=170 alt="mvc2_struts.gif (6329 bytes)" src="http://barracudamvc.org/Barracuda/images/mvc2_struts.gif" width=410&gt;&lt;/P&gt;
&lt;P align=left&gt;Struts consists of the following architectural pieces:&lt;/P&gt;
&lt;OL&gt;
&lt;LI&gt;
&lt;P align=left&gt;&lt;A name=Struts_Controller&gt;&lt;STRONG&gt;Controller&lt;/STRONG&gt;&lt;/A&gt; - Struts provides a Controller servlet to give the developer a default Model 2 flow control implementation. This servlet acts as a kind of "central nervous system" to ensure that requests gets routed, handled, and rendered according to this pattern. The specific processing flow runs something like this:&lt;/P&gt;
&lt;UL&gt;
&lt;LI&gt;uses an XML configuration file to map URIs Action classes (the default name is struts-config.xml, but its not hardwired) 
&lt;LI&gt;when a request is received route it to the appropriate Action... 
&lt;UL&gt;
&lt;LI&gt;identify from the URI the appropriate mapping for this request 
&lt;LI&gt;use this mapping to select the corresponding action class 
&lt;LI&gt;if this is the first request for the action class, instantiate an instance of that class and cache it or future use 
&lt;LI&gt;optionally populate the properties of an ActionForm bean associated with this mapping. 
&lt;LI&gt;call the perform() method of the action object, passing on a reference to the mapping that was used, and the request and response objects. The action also has access to the underlying ActionServlet and ServletContext. &lt;/LI&gt;&lt;/UL&gt;
&lt;LI&gt;Actions may take data from the request, may update the Model (beans), handle any errors, and then return a "forwarding address" to the Controller. This "forwarding address" may be a page, another Action, or even a URL. 
&lt;LI&gt;The Controller returns the Response to the container, which may invoke a JSP, fetch an HTML page, or whatever else is required. 
&lt;LI&gt;The JSP may display data from Model (beans, session context, etc), access the Struts mappings to render a URL, and/or access message resources to display internationalized text. &lt;/LI&gt;&lt;/UL&gt;
&lt;LI&gt;
&lt;P align=left&gt;&lt;A name=Struts_Model&gt;&lt;STRONG&gt;Model&lt;/STRONG&gt;&lt;/A&gt; - A common task in most applications is getting data from the HTTP Request into the Model layer (which acts as a facade to underlying business objects). Struts provides ActionForm and Action classes to streamline this process. &lt;/P&gt;
&lt;P align=left&gt;An Action class acts as an "adapter" between the web layer (HttpServletRequest) and the business logic (JavaBeans, EJBs, whatever). An ActionForm is really just a server-side representation of the current contents of an input form. Typically a developer writes Java code that extends these classes to provide the implementation details specific to a particular action.&lt;/P&gt;
&lt;P align=left&gt;This layer also provides a mechanism for developers to validate the data and redirect flow if an error occurs.&lt;/P&gt;
&lt;LI&gt;
&lt;P align=left&gt;&lt;A name=Struts_View&gt;&lt;STRONG&gt;View&lt;/STRONG&gt;&lt;/A&gt; - Of course, applications also need to generate responses to client requests. In Struts, this occurs in the View portion of the framework. Views are typically rendered with JSPs, which use Java Taglibs to pull data out of the Model and insert it into the JSP page. Once the page has been populated with data, it is ready to be returned to the client.&lt;/P&gt;
&lt;P align=left&gt;As one might guess, Struts has invested a lot of effort in the Taglibs end of the framework. Specifically, Struts offers:&lt;/P&gt;
&lt;UL&gt;
&lt;LI&gt;&lt;STRONG&gt;Bean taglib&lt;/STRONG&gt; - tags useful for defining new beans (from a variety of sources) and rendering them in the page. 
&lt;LI&gt;&lt;STRONG&gt;HTML taglib&lt;/STRONG&gt; - tags useful for creating various HTML elements dynamically, including input forms 
&lt;LI&gt;&lt;STRONG&gt;Logic taglib&lt;/STRONG&gt; - tags that allow a developer to put conditional logic in the JSP page (Comparators, Conditionals, Iteration, etc) 
&lt;LI&gt;&lt;STRONG&gt;Template taglib&lt;/STRONG&gt; - tags that are useful in creating dynamic JSPs templates for pages that share a common format 
&lt;LI&gt;
&lt;P align=left&gt;&lt;STRONG&gt;Custom tag support&lt;/STRONG&gt; - JSPs in general allow a developer to create their own custom tags as well -- you can integrate third party tag libraries, write your own app-specific ones, or subclass and specialize the existing Struts tags&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;
&lt;P align=left&gt;It is also possible to use a different technology for the view layer, without giving up on the controller and model layer features of Struts. That could be as simple as using Faces components instead of the Struts tags, or as radical as using Velocity, WebMacro, or Cocoon instead. The automatic support for ActionForms and validation can continue to be used, because Struts cares about HttpServletRequest parameters, not the technology used to submit them&lt;/P&gt;
&lt;LI&gt;
&lt;P align=left&gt;&lt;A name=Stuts_Utilities&gt;&lt;STRONG&gt;Utilities&lt;/STRONG&gt;&lt;/A&gt; - Struts offers several utilities aimed at specific aspects of the development process:&lt;/P&gt;
&lt;UL&gt;
&lt;LI&gt;&lt;STRONG&gt;Localization&lt;/STRONG&gt; - Struts uses the standard Java localization mechanism, augmented with a standard Message Resource that can be accessed by various custom tags. The tags can automatically display the appropriate text for the user's locale. 
&lt;LI&gt;&lt;STRONG&gt;Digester&lt;/STRONG&gt; - a simple but powerful abstraction around a SAX-based XML parser that is handy for converting XML documents into trees of Java objects with an isomorphic structure. The digester is now available through the Jakarta Commons project as a standalone utility. 
&lt;LI&gt;
&lt;P align=left&gt;&lt;STRONG&gt;Database support &lt;/STRONG&gt;- Struts allows you do define JDBC data sources from a config file and provides a JDBC connection pooling mechanism&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;
&lt;LI&gt;
&lt;P align=left&gt;&lt;STRONG&gt;&lt;A name=Struts_Future&gt;Future&lt;/A&gt; directions&lt;/STRONG&gt; - Struts also has some interesting ideas for future development:&lt;/P&gt;
&lt;UL&gt;
&lt;LI&gt;a "ValidatorForm" is being integrated with Struts that offers &lt;STRONG&gt;client and server side validations&lt;/STRONG&gt; from the same XML configuration. It is now available as a plug-in. 
&lt;LI&gt;an &lt;STRONG&gt;advanced templating package called "Tiles"&lt;/STRONG&gt; that is appropriate for building portals and other complex layouts 
&lt;LI&gt;a &lt;STRONG&gt;regular expression scripting language&lt;/STRONG&gt; that can be used to more easily/powerfully express what data to retrieve from collections of JavaBeans (while many prefer XPath syntax, they will probably adopt whatever the JSP Taglibs working group decides upon...looks like something similar to JavaScript) 
&lt;LI&gt;support for &lt;STRONG&gt;dynamic properties within ActionForms&lt;/STRONG&gt; (so that you don't have to hand-create a bean class with getters and setters -- you can use a hashmap structure instead) 
&lt;LI&gt;
&lt;P align=left&gt;&lt;STRONG&gt;workflow mechanism&lt;/STRONG&gt; that can be specified via an XML descriptor&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;/LI&gt;&lt;/OL&gt;&lt;/LI&gt;&lt;/OL&gt;
&lt;HR SIZE=1&gt;

&lt;P&gt;&lt;A name=Comparison-Contrast&gt;&lt;STRONG&gt;Comparison / Contrast&lt;/STRONG&gt;&lt;/A&gt; - Now that we've addressed the basics, it may prove helpful to look at how the frameworks compare on specific issues. 
&lt;OL&gt;
&lt;LI&gt;
&lt;P align=left&gt;&lt;U&gt;&lt;STRONG&gt;&lt;A name=CC_UI&gt;UI Issues&lt;/A&gt;&lt;/STRONG&gt;&lt;/U&gt; - &lt;/P&gt;
&lt;OL&gt;
&lt;LI&gt;
&lt;P align=left&gt;&lt;U&gt;&lt;STRONG&gt;&lt;A name=CC_UI_Pres_Logic_Separation&gt;Separating&lt;/A&gt; Presentation from Programming Logic&lt;/STRONG&gt;&lt;/U&gt; - It is important to evaluate how well the various approaches succeed in separating presentation from programming logic (which is a generally accepted "Good Thing"). By separation we typically mean that code that gets run on the server should be cleanly separated from code that will get processed on the client -- Java shouldn't contain HTML, and HTML shouldn't contain Java. So how do the various approaches fare?&lt;/P&gt;
&lt;P align=left&gt;&lt;EM&gt;&lt;STRONG&gt;Struts&lt;/STRONG&gt;&lt;/EM&gt; - Struts (and similar "Pull-MVC" template approaches) achieve separation by expressing "Controller" code in Java (usually Servlets), and "View" code as *ML (usually&amp;nbsp; in JSPs). Java Beans are used for the "Model" layer, and taglibs act as the bridge -- controller code processes the request, updates model beans, and then forwards processing flow to a JSP which uses Taglibs to pull data back out of the underlying bean layer and embed it into the View. &lt;/P&gt;
&lt;P align=left&gt;On the surface, it sounds pretty good. Upon closer inspection, however, we can see several flaws with this approach.&lt;/P&gt;
&lt;OL&gt;
&lt;LI&gt;
&lt;P align=left&gt;JSPs allow Java code (Scriptlets) to be embedded in the markup (thereby breaking the separation). There is no mechanism to force developers &lt;EM&gt;not&lt;/EM&gt; to do this, and current practice shows they frequently do so. While some might argue that this is not a flaw (after all, it gives the developers greater choice), most knowledgable Struts developers will advise strongly against using Scriptlets. The thrust of this critique is that the basic architecture of JSPs precludes any means of enforcing this recommendation.&lt;/P&gt;
&lt;LI&gt;
&lt;P align=left&gt;Even if page authors do not use Scriptlets, they must reference taglibs in order to get data into the page (and JSPs offers no mechanism to avoid this implication). What this means is that we end up embedding server-side programming logic into the markup. (It should be noted that most template approaches try and temper this fact by calling it "presentation logic", subsequently insisting that its ok to mix that in with the markup. Nevertheless, this logic is still being processed on the server, and as such it ultimately breaks clean separation.)&lt;/P&gt;
&lt;LI&gt;
&lt;P align=left&gt;While this effect might be tolerable if all it allowed was the simple inclusion of data (ie. similar to server-side includes) taglibs inevitably allow for a far more complex logical constructions, including looping, conditional evaluations, etc. This effectively introduces a server side scripting language into the equation -- developers usually end up needing to know markup, JavaScript (for client side scripting), Java, plus the taglibs (server-side scripting) syntax. This ultimately pollutes clean separation, and makes the development process more complex, not less.&lt;/P&gt;
&lt;LI&gt;
&lt;P align=left&gt;It should also be noted the using taglibs ultimately result in a JSP that is not valid markup, which therefore makes it difficult to be edited using standard off-the-shelf markup editing tools. While there are some tools that offer limited support for JSP with custom tags (Ultradev), a vast majority of developers end up editing JSPs by hand.&lt;/P&gt;
&lt;LI&gt;
&lt;P align=left&gt;It should also be observed that it is typically developer types -- not designers -- who end up adding "presentation logic" to JSPs. This ultimately fails to scale because you end up with designers and developers trying to work from the same physical file (always a good indication that we have failed to achieve proper separation).&lt;/P&gt;
&lt;LI&gt;
&lt;P align=left&gt;Ultimately, most of these criticisms stem from architectural implications of JSPs (rather than Struts per se). Nevertheless they are still applicable since the vast majority of Struts applications use JSPs as their rendering mechanism. Interestingly, almost all "Pull-MVC" implementations are also subject to these same criticisms, and fail to maintain true separation of code from content. &lt;/P&gt;&lt;/LI&gt;&lt;/OL&gt;
&lt;P align=left&gt;&lt;EM&gt;&lt;STRONG&gt;Barracuda&lt;/STRONG&gt;&lt;/EM&gt; - In contrast to most other templating mechanisms, Barracuda builds on XMLC to implement what is sometimes called a "Push-MVC" model. In this approach, HTML and XML source files are compiled by XMLC into Java classes that implement the DOM interfaces. Java Controller code then (usually in Servlets) can be used to manipulate the Views (presentation markup) without actually mixing code and content. There are a number of advantages to this approach:&lt;/P&gt;
&lt;OL&gt;
&lt;LI&gt;
&lt;P align=left&gt;The separation of Presentation and Programming logic is both clean and &lt;EM&gt;enforceable&lt;/EM&gt; (there is no way for a developer to actually embed server side logic into the markup)&lt;/P&gt;
&lt;LI&gt;
&lt;P align=left&gt;Because the presentation markup remains logic-free -- the extent of any embedding is ultimately limited to flagging markup elements with id or class attributes -- the markup remains 100% valid HTML, XML, etc, and can be manipulated by the designer in a wide variety of standard page editing tools.&lt;/P&gt;
&lt;LI&gt;
&lt;P align=left&gt;Because the markup is contained in a physically separate file from any programming logic, both designer and developer can work simultaneously without interfering with one another -- the set of ids specified in the markup is the only contract that binds the two. This results in very loose coupling which makes for excellent parallel development.&lt;/P&gt;
&lt;LI&gt;
&lt;P align=left&gt;In addition, the designer can use/maintain a working mockup of the application entirely within the markup files. This further streamlines the development process. &lt;/P&gt;&lt;/LI&gt;&lt;/OL&gt;
&lt;P align=left&gt;For this reason, we can assert that XMLC delivers better code-content separation. There are some limitations to this approach however. Any time we are expressing all logic (including that pertaining to presentation issues) in server-side Java, the code must necessarily have some knowledge of the presentation structure. For instance, the code needed to render a JDBC result set will vary depending on whether the markup structure that will contain the data is a list or a table structure. &lt;/P&gt;
&lt;P align=left&gt;Consequently, it is easy for dependencies to be introduced that require developer changes when the design layout changes. While this is a reasonable result of keeping the presentation layer intentionally pure, it does actually complicate the development process in certain cases (although we would argue not so much as the "pure" Pull-MVC model described previously).&lt;/P&gt;
&lt;P align=left&gt;To improve this situation, Barracuda offers a custom BTemplate component which actually acts like a mini-template engine to apply a "minimalistic" Pull-MVC approach to a section of markup. Using this approach, the template component parses a section of markup looking for any "directives" it might contain. These directives are very simple, allowing us to specify simple logic within the markup -- basically we can get data from the server model and perform a simple iteration loop. &lt;/P&gt;
&lt;P align=left&gt;The advantage of this approach is that it allows simple page layout logic to be expressed in markup, which greatly decouples the designer from the developer -- the designer can dramatically modify the structure of the page layout without requiring the developer to make any changes to the server side code. In this sense, the BTemplate approach is architecturally similar to taglibs. &lt;/P&gt;
&lt;P align=left&gt;While this might seem hypocritical given our previous diatribe on putting logic in the template, we believe there are some key differences worth noting:&lt;/P&gt;
&lt;OL&gt;
&lt;LI&gt;
&lt;P align=left&gt;This "Pull-MVC" implementation is so minimalistic it barely qualifies as scripting -- there are no conditional expressions, etc. -- you can set data, perform simple iterations, and discard nodes. That's it!&lt;/P&gt;
&lt;LI&gt;
&lt;P align=left&gt;Instead, its really much closer to the way stylesheets work -- the markup uses ids to refer to "processing instructions" that are contained in a separate file. This allows the markup to remain 100% valid at all times.&lt;/P&gt;
&lt;LI&gt;
&lt;P align=left&gt;We can safely avoid "feature creep" in our scripting constructs because the BTemplate is implemented as a Barracuda component. If a developer wants more powerful scripting features that are beyond the scope of this component they should use a different component. Similarly, if embedding even this limited amount logic in a presentation template makes a developer uncomfortable, &lt;EM&gt;they can simply choose not to use it&lt;/EM&gt;.&lt;/P&gt;&lt;/LI&gt;&lt;/OL&gt;
&lt;P align=left&gt;Ultimately then, the Barracuda approach to "Pull-MVC" is that we recognize a number of cases where it is really useful (80%), but because we have implemented it as a component, we don't really need to worry about all the weird cases where it would become utterly complicated (20%). We can do this precisely because of the underlying component model -- BTemplate is just another component. The result is an approach which gives developers the best of both worlds without locking them into any one way of doing things. &lt;/P&gt;
&lt;P align=left&gt;Barracuda makes it possible to maintain absolute separation of code from content, while at the same time making it easy to fudge on that rule if the developer wishes to allow it for the sake of handling a very common set of situations (simple data substitutions, looping). At the same time we avoid the slippery slope that most templating approaches fall into -- they ultimately need a full fledged scripting language for manipulating the markup since they start with the assumption that all markup will be manipulated within the context of the template. Ah the beauty of components :-)&lt;/P&gt;
&lt;LI&gt;
&lt;P align=left&gt;&lt;U&gt;&lt;STRONG&gt;&lt;A name=CC_UI_Page_Design&gt;Page Design&lt;/A&gt;&lt;/STRONG&gt;&lt;/U&gt; - By page design, we really mean that a development approach should support the ability for Page Authors to modify the layout of pages within standard HTML page editing tools like Ultradev, Dreamweaver, etc. These tools support content designers in their primary task -- defining the look and feel of a web application. &lt;/P&gt;
&lt;P align=left&gt;&lt;EM&gt;&lt;STRONG&gt;Struts&lt;/STRONG&gt;&lt;/EM&gt; - As mentioned in the previous section, approaches like Struts tend to view JSPs as a great construct for dealing with markup. Unfortunately, by embedding custom tags we create something that is not valid HTML, XML, etc. Not surprisingly, tools support for JSPs with custom Taglibs is lagging. There have been some simple "tag aware" plugins created for Ultradev, and the newest version of the JSP spec makes it possible for JSPs to be defined as actual XML.&amp;nbsp; For the most part, however, the JSP approach (and most other template engines, for that matter) does not adequately solve Page Design requirements. In practice, most JSPs today are still edited by hand.&lt;/P&gt;
&lt;P align=left&gt;&lt;EM&gt;&lt;STRONG&gt;Barracuda&lt;/STRONG&gt;&lt;/EM&gt; - As per the discussion of XMLC above, the Barracuda approach allows for easy integration with any page design tools that produce valid markup (HTML, WML, XML, etc). In addition, the designer can easily modify the pages without developer intervention, and maintain a working mockup of the application that is completely detached from the developer's code and can be viewed through a standard browser. We feel Barracuda / XMLC does extremely well in this particular area. &lt;/P&gt;
&lt;LI&gt;
&lt;P align=left&gt;&lt;U&gt;&lt;STRONG&gt;&lt;A name=CC_UI_Taglibs&gt;Taglibs&lt;/A&gt;&lt;/STRONG&gt;&lt;/U&gt; - The need for taglibs is actually somewhat questionable, unless of course we assume that JSP integration must be part of a presentation framework, in which case they become much more important. The purpose of this section is to address how each technology supports the concept.&lt;/P&gt;
&lt;P align=left&gt;&lt;EM&gt;&lt;STRONG&gt;Struts&lt;/STRONG&gt;&lt;/EM&gt; - As we have already seen, embedding Taglibs inside JSPs is an integral part to the Struts approach. Struts currently supports 4 distinct tag libraries: there is one for Bean interactions, another for HTML elements, a third for Logical constructs, and one for Template support. Not surprisingly, Struts developers are also increasingly looking to the &lt;A href="http://jakarta.apache.org/taglibs/index.html"&gt;&lt;FONT color=#002c99&gt;Jakarta Taglibs Project&lt;/FONT&gt;&lt;/A&gt;, which defines over 20 additional tag libraries. Consequently, it is safe to assume that Taglibs support in Struts will continue to be excellent.&lt;/P&gt;
&lt;P align=left&gt;&lt;EM&gt;&lt;STRONG&gt;Barracuda&lt;/STRONG&gt;&lt;/EM&gt; - Barracuda currently has no Taglibs offerings, although as was noted previously, the BTemplate approach is conceptually similar to the taglibs approach. While it does seem possible for Barracuda to support Taglibs in a manner similar to that proposed by JSR-127 (autogenerating), it is not clear why we would actually want to do that (except perhaps to spur Barracuda adoption by those already committed to JSP technology).&lt;/P&gt;
&lt;LI&gt;
&lt;P align=left&gt;&lt;U&gt;&lt;STRONG&gt;UI &lt;A name=CC_UI_Layout&gt;Layout&lt;/A&gt;&lt;/STRONG&gt;&lt;/U&gt; - In stated, client-server type applications (ie Swing, VB, etc), components are generally responsible for managing both data and presentation (how the component renders on the screen). Within the webapp paradigm, the separation of presentation from logic generally means that the server side code only needs to worry about the data -- layout issues are left up to the markup. There is general agreement in most camps that this is another "Good Thing". &lt;/P&gt;
&lt;P align=left&gt;While there are some approaches like WingS, ECS, and Swinglets that try and drive layout from the server code as well (in other words, the server code takes care of &lt;EM&gt;everything&lt;/EM&gt;, including generating all the markup), the general consensus among webapp developers is that these approaches are "Not Such a Good Thing". &lt;/P&gt;
&lt;P align=left&gt;&lt;EM&gt;&lt;STRONG&gt;Struts / Barracuda&lt;/STRONG&gt;&lt;/EM&gt; - we know for sure that Struts and Barracuda are NOT taking this latter approach -- layout remains in the presentation layer where it belongs. &lt;/P&gt;
&lt;LI&gt;
&lt;P align=left&gt;&lt;U&gt;&lt;STRONG&gt;&lt;A name=CC_UI_Localization&gt;Localization&lt;/A&gt;&lt;/STRONG&gt;&lt;/U&gt; - When localizing a web application, there are really two different types of text that needs to be localized: &lt;EM&gt;dynamic&lt;/EM&gt; and &lt;EM&gt;static&lt;/EM&gt;. Dynamic text -- often business data from a database or EJB -- will typically need to be localized on a per-request basis. In other words, if a user requests a particular screen repeatedly, the data portions of that screen must usually be repopulated every time the page is requested to make sure the resulting screen contains up-to-date information when it is returned to the client. Static text, on the other hand, usually corresponds more closely to presentation data -- stuff like labels, textfields, etc. As such this information generally doesn't change every time the client requests a page. Its static, and thus it tends to stay the same within the context of a given locale. &lt;/P&gt;
&lt;P align=left&gt;The standard Java libraries already provide a number of localization features to deal with localizing dynamic data. Its more interesting, however, to see how the various approaches handle static text that needs to be localized. There are typically two basic approaches:&lt;/P&gt;
&lt;OL&gt;
&lt;LI&gt;
&lt;P align=left&gt;maintain multiple localized versions of each individual template (efficient, because only the dynamic portions of the template need to be localized every time the template is used, but difficult to maintain since we have multiple copies of the presentation layout that must be kept in sync with one another) -OR-&lt;/P&gt;
&lt;LI&gt;
&lt;P align=left&gt;dynamically set all localized text (both static and dynamic) every time the template is requested (easier to maintain, since we only have one copy of the template to manage, but not nearly as efficient, since we are dynamically setting text that is really quite static, at least within the context of a given client locale)&lt;/P&gt;&lt;/LI&gt;&lt;/OL&gt;
&lt;P align=left&gt;It may be helpful to look at how the various presentation frameworks approach this issue.&lt;/P&gt;
&lt;P align=left&gt;&lt;EM&gt;&lt;STRONG&gt;Struts&lt;/STRONG&gt;&lt;/EM&gt; - It appears to me that Struts offers very little in terms of Localization support beyond what is already available in the standard Java class libraries.&amp;nbsp; It appears that most Struts developers adopt approach #2 above, whereby all the text in a JSP is replaced every time the page is generated. This naturally raises questions about performance in high load situations.&lt;/P&gt;
&lt;P align=left&gt;&lt;EM&gt;&lt;STRONG&gt;Barracuda&lt;/STRONG&gt;&lt;/EM&gt; - While not precluding either of the options described above, Barracuda uses an approach &lt;A href="http://barracudamvc.org/Barracuda/docs/barracuda_vs_struts.html#Localization"&gt;&lt;FONT color=#002c99&gt;described previously&lt;/FONT&gt;&lt;/A&gt; to offer a solution that actually provides the best of both worlds -- performance and maintainability. This mechanism ensures that localized versions of the master template are automatically produced from standard property files: the localization of static text occurs at compile time, and yet the designer still only has to maintain one master template no matter how many locales need to be supported. The proper templates are selected on the server using a DOM loader utility that works off of a target locale in a manner similar to that of ResourceBundles. This has turned out to be a very popular feature within the Barracuda framework.&lt;/P&gt;
&lt;LI&gt;
&lt;P align=left&gt;&lt;U&gt;&lt;STRONG&gt;Support for multiple &lt;A name=CC_UI_Multiple_Clients&gt;Client Types&lt;/A&gt;&lt;/STRONG&gt;&lt;/U&gt; - When we talk about supporting multiple client types, what we really mean is that we should be able to create applications for various types of client devices (web browsers, cell phones, PDAs, etc).&lt;/P&gt;
&lt;P align=left&gt;&lt;EM&gt;&lt;STRONG&gt;Struts&lt;/STRONG&gt;&lt;/EM&gt; - By using JSPs to create the views, Struts can support multiple types of client markup ranging from HTML to XML.&lt;/P&gt;
&lt;P align=left&gt;&lt;EM&gt;&lt;STRONG&gt;Barracuda&lt;/STRONG&gt;&lt;/EM&gt; - By coding against the DOM interfaces, Barracuda can also support multiple client types. We currently support HTML, WML, and XML, and it is relatively straightforward to add support for other standard DOMs as well. If it can be accessed via a DOM interface, Barracuda can work with it.&lt;/P&gt;
&lt;LI&gt;
&lt;P align=left&gt;&lt;U&gt;&lt;STRONG&gt;Support for multiple &lt;A name=CC_UI_Multiple_Skins&gt;Client Skins&lt;/A&gt;&lt;/STRONG&gt;&lt;/U&gt; - The concept of skins is the idea that an application's look &amp;amp; feel should be able to be drastically altered without affecting the basic functionality of the application. In other words, even though various input controls like buttons, text, and lists might change in appearance or location, the app will generally continue to function in exactly the same way. &lt;/P&gt;
&lt;P align=left&gt;We can see this type of "Skinnable Interface" to some extent in Swing's L&amp;amp;F toolkit, but even better in an application like RealJukebox. Ideally, we would like to be able easily create the same type of effect in webapps. While it might seem that the separation between code and content should make this relatively straightforward, support is lacking in most frameworks.&lt;/P&gt;
&lt;P align=left&gt;&lt;EM&gt;&lt;STRONG&gt;Struts&lt;/STRONG&gt;&lt;/EM&gt; - To the best of my knowledge, Struts does not actually offer anything in this area. JSPs in general tend to complicate this goal, since they allow for programming logic to be embedded in the markup. If a designer wishes to create an alternate skin, much of the presentation logic contained in the master JSP would need to be duplicated. In practice, this quickly leads to maintainability problems.&lt;/P&gt;
&lt;P align=left&gt;&lt;EM&gt;&lt;STRONG&gt;Barracuda&lt;/STRONG&gt;&lt;/EM&gt; - At this point in time, Barracuda does not yet offer anything specific to creating skinnable webapps yet either. It is, however, on the roadmap. The fact that Barracuda enforces such strict separation between code and content actually makes the problem much easier to solve. At this point, we are leaning toward a solution which would be similar in many ways to the way Barracuda handles localization (ie. supporting multiple skins and automatically localizing those skins based on a master properties file). More on this later as soon as details become available...&lt;/P&gt;
&lt;LI&gt;
&lt;P align=left&gt;&lt;U&gt;&lt;STRONG&gt;&lt;A name=CC_UI_Client_Capabilities&gt;Client Capabilities&lt;/A&gt;&lt;/STRONG&gt;&lt;/U&gt; - When we speak of concept, we are recognizing the fact that in many cases server side code may need to take into account the clients' capabilities when generating UI code. For instance, what version of browser is the client using? What version of a particular markup language do they support? Do they support scripting? and so forth. Some of this information can be determined from the underlying Servlet request, but extracting it is often a manual process. It would be nice if the frameworks offered something specific in this regard.&lt;/P&gt;
&lt;P align=left&gt;&lt;EM&gt;&lt;STRONG&gt;Struts&lt;/STRONG&gt;&lt;/EM&gt; - To the best of my knowledge, Struts does not offer any specific features that address this area.&lt;/P&gt;
&lt;P align=left&gt;&lt;EM&gt;&lt;STRONG&gt;Barracuda&lt;/STRONG&gt;&lt;/EM&gt; - As described in the &lt;A href="http://barracudamvc.org/Barracuda/docs/barracuda_vs_struts.html#Client_Capabilities"&gt;&lt;FONT color=#002c99&gt;Client Capabilities&lt;/FONT&gt;&lt;/A&gt; section, Barracuda automatically identifies basic client capabilities such as client type (NN, IE, etc), markup type/version (HTML 3.2, HTML 4.0, XML 1.0, etc), scripting type/version (Javascript 1.0? 1.1? etc), as well as target client locale. This information is automatically made available to all Barracuda code. In addition, Barracuda components may take advantage of this information when rendering, to take advantage of client functionality, rather than simply rendering based on a lowest common denominator approach.&amp;nbsp; In the future, we anticipate the validation framework will also take advantage of this information to allow for custom client side validations if the client is capable of supporting it.&lt;/P&gt;
&lt;LI&gt;
&lt;P align=left&gt;&lt;U&gt;&lt;STRONG&gt;&lt;A name=CC_UI_Client_Accessibility&gt;Client Accessibility&lt;/A&gt;&lt;/STRONG&gt;&lt;/U&gt; - By client accessibility we mean the ability to automatically support clients with disabilities in ways defined by WAI. This type of functionality is currently built into Swing, but there is not a well defined model for how it would integrate into web browsers and other devices that might interfaces with web apps.&lt;/P&gt;
&lt;P align=left&gt;&lt;EM&gt;&lt;STRONG&gt;Struts&lt;/STRONG&gt;&lt;/EM&gt; - This functionality is outside the scope of Struts.&lt;/P&gt;
&lt;P align=left&gt;&lt;EM&gt;&lt;STRONG&gt;Barracuda&lt;/STRONG&gt;&lt;/EM&gt; - This functionality is also outside the scope of Barracuda, although if we had to take a stab at implementing it, it seems that Skins would be the way to go, rather than trying to autogenerate something (which is the approach the Faces initiative seems to be headed).&lt;/P&gt;&lt;/LI&gt;&lt;/OL&gt;
&lt;LI&gt;
&lt;P align=left&gt;&lt;U&gt;&lt;STRONG&gt;&lt;A name=CC_Flow&gt;Flow Control Issues&lt;/A&gt;&lt;/STRONG&gt;&lt;/U&gt; - &lt;/P&gt;
&lt;OL&gt;
&lt;LI&gt;
&lt;P align=left&gt;&lt;U&gt;&lt;STRONG&gt;&lt;A name=CC_Flow_Event_Handling&gt;Event Handling&lt;/A&gt;&lt;/STRONG&gt;&lt;/U&gt; - The real question to be addressed here is: How do these frameworks handle events? Of course in order to answer this question we must first examine how each framework defines the term "event". &lt;/P&gt;
&lt;P align=left&gt;&lt;EM&gt;&lt;STRONG&gt;Struts&lt;/STRONG&gt;&lt;/EM&gt; - Taking our cue from the J2EE Blueprints, we could simply view an "event" as being synonymous with a user "gesture" (any action on the client that results in a subsequent HTTP Request to the server). For most frameworks this definition is sufficient, and Struts is no exception -- the master controller is responsible for mapping URL requests to "Actions", which are more or less synonymous with "event handlers". For Struts, then, &lt;EM&gt;events are a simple mechanism to map one or more URLs to a single block of code on the server and nothing more&lt;/EM&gt;.&lt;/P&gt;
&lt;P align=left&gt;Now that we understand what events are in Struts, we also need to consider how Struts delivers them. Some frameworks treat events as Strings that map to individual methods within an object on the server (ie. a servlet, java bean, or some other object). The problem with this approach is that it inevitably suffers from performance or maintainability -- methods within the object must either be invoked through reflection (not particularly fast) or with a manually written case statement (not particularly maintainable). Fortunately, Struts takes a different tack -- events are mapped to Action classes, the classes are instantiated and cached, and the Actions' perform() method is invoked every time an "event" needs to be dispatched. This approach should scale well under load.&lt;/P&gt;
&lt;P align=left&gt;There are some technical details worth noting:&lt;/P&gt;
&lt;OL&gt;
&lt;LI&gt;
&lt;P align=left&gt;For every request, there is a 1:1 mapping between user gestures and actions. While you could have mutiple gestures handled by the same action on the server, you will never have a gesture handled by multiple actions. This makes the Action handlers more or less monolithic in nature.&lt;/P&gt;
&lt;P align=left&gt;(Note that while you could have an Action forward control to another action, thereby technically having multiple Actions handle an event, in reality the monolithic critique still applies -- at the end of the chain, the gesture is still being handled by just one Action. For an explanation of why this is important, &lt;A href="http://barracudamvc.org/Barracuda/docs/events/event_faq.html#3"&gt;&lt;FONT color=#002c99&gt;click here&lt;/FONT&gt;&lt;/A&gt;)&lt;/P&gt;
&lt;LI&gt;
&lt;P align=left&gt;When writing Struts Actions, you must consider threadsafety issues, just like you would when writing a servlet -- there is one instance of each Action class, with (potentially) multiple threads using it. Consequently, Actions need to be written in a threadsafe fashion (ie. avoid the use of class variables, etc).&lt;/P&gt;
&lt;LI&gt;
&lt;P align=left&gt;Once instantiated, Actions stay in memory for the lifespan of the Application. While this means that a very large app could conceivably end up with every possible Action in memory at once, this will probably not have an adverse impact on footprint since these objects are typically very lightweight.&lt;/P&gt;
&lt;LI&gt;
&lt;P align=left&gt;ActionForms, on the other hand, are usually instantiated / scoped on a per-request basis; an Action class will only ever receive one ActionForm instance (for the form submitted for the current request)&lt;/P&gt;&lt;/LI&gt;&lt;/OL&gt;
&lt;P align=left&gt;I don't think any of these issues will adversely impact performance (although the use of reflection in populating the ActionForms might). The most significant implication, in my mind, is the fundamentally monolithic nature of the Request-Action relationship.&lt;/P&gt;
&lt;P align=left&gt;&lt;EM&gt;&lt;STRONG&gt;Barracuda&lt;/STRONG&gt;&lt;/EM&gt; - While the Barracuda event model certainly encompasses the basic functionality of events as defined in Struts (notifying the server that something happened on the client), it does much more as well, offering a number of unique features that distinguish it from other event frameworks. &lt;/P&gt;
&lt;P align=left&gt;To begin with, &lt;STRONG&gt;Barracuda models events as first class Java objects&lt;/STRONG&gt;. This allows us to avoid the performance / maintainability issues associated with treating events as a String that corresponds to a method (described above in the Struts section). In addition, it makes for strong typing and allows us to catch errors sooner (at compile time) rather than later (runtime). Furthermore, such an approach presents the developer coming from a rich client background with a familiar paradigm (it feels more like client server).&lt;/P&gt;
&lt;P align=left&gt;One of the challenges in converting URLs to event objects is performance: how do we instantiate events in such a way that minimizes overhead and maximizes throughput. In Barracuda, we solve this problem by using an event pooling mechanism -- events are instantiated via reflection the first time they are needed and then stored in an event pool for subsequent reuse. This makes event dispatching very fast. (It should also be noted that this is one of the few places we use reflection within the Barracuda framework).&lt;/P&gt;
&lt;P align=left&gt;Of course, one of the drawbacks of creating events which are first class Java objects is that they must be defined in physical class files. While it is relatively easy to pre-define generic events (ie. ActionEvent), &lt;STRONG&gt;web developers often need to specify custom events&lt;/STRONG&gt; which correspond to the business API that the web application exposes (ie. GetLogin, AttemptLogin, GetUsers, etc). Indeed, this is an area where a webapp event model will inevitably differ from its rich client counterparts. For many developers, defining a set of events in actual Java files is a tedious process they'd like to avoid -- they would much rather specify them from some configuration file.&lt;/P&gt;
&lt;P align=left&gt;Unfortunately, it is currently difficult to define events fro