Professional Documents
Culture Documents
Java Projects
Java Projects
Outline
Look at three java projects Different architectures adopted Problems encountered and lessons learnt Tools and other useful techniques
The Systems
Clips a web-based file system for distributing course materials Jwebagent a java runtime for our in-house scripting language Tech lounge a web-based developer documentation store
Clips Requirements
A simple to use, intuitive interface Handle all file types Accessible from any location Date controlled display of materials Easy transfer of materials from class to class Work well with existing mainframe class management system Work within the UTDirect portal framework
Meta-Data Details
Directory nodes store information about a directory: name, creation time, description, etc Binary nodes store information about a binary file: name, foreign key, size, content type, etc Directory nodes can contain either binary nodes or other directory nodes (hierarchy) clips meta data
Clips Architecture
XML database (binaries and Meta-data)
User
mainframe Adabas
Broker Natural
Existing class management system
Useful Tools
Log4j used for debugging and recording production exceptions (system written before Java 1.4) JDOM very user friendly api for manipulating the XML cos.jar used to parse the multipart encoded forms Entire-X broker ACI for Java Java stub generator for mainframe modules Tamino - native XML database
Lessons Learnt
Be careful of scriplets in JSP; they expand to fill the available space! Better to use a controller servlet to organize navigation through JSPs XP and pair-programming works A Java developers best friend is Goggle
Controller servlet
Auth Task
Auth Task
mainframe
XML store
mainframe
XML store
Jwebagent
.WBX file
Jwebagent
HTML file
What is Webagent?
A scripting language with a syntax like Natural (mainframe language) Scripts transformed into C++ objects forming a virtual machine which is serialized to a .WBX file Runtime reads .WBX file, rebuilds the C++ virtual machine and executes it. Pro: easy and productive for creating web front ends to mainframe applications. Con: limited functionality
Why Jwebagent?
Same as Webagent but the rebuilding of the runtime is done in Java plus Enable java classes to run existing Webagent scripts Enable Webagent scripts to use java classes Improve execution speed no process forking and script buffering
Runtime
vmOp broker vmOp broker vmOp broker vmOp vmOp vmOp Serial code object
file request
Servlet
Executor
Data buffer
Request context
WBX file
Useful Tools
Junit unit testing framework (junit.org) JProbe application analyzer (Quest Software) JMeter load testing suite (Apache.org) HttpExplorer gui http request and response tool (in-house) Jedit text editor (Jedit.org) IntelliJ IDEA Java IDE (Jet Brains) CVS (Tortoise, WinCVS, Putty for SSH) Xvi32 hex editor
JVM Tuning
Changed default of client mode to server mode (20% improvement) Other settings have given some improvements Use incremental GC rather than stop the world style Uses the flags that control survivor ratio for the GC generations we have short lived objects Increased default memory allocation
Lessons learned
Always build a test suite before refactoring Never optimize until you know what to optimize Do not assume GC defaults are optimal Java needs lots of memory! Allow for distractions in your project estimates (estimated time 9 months, actual time start to finish 2.5 years, actual time spent on project 10 months)
Tech Lounge
Project Goals
Nice, easy to use documentation store Replace mainframe based system Provide better editing and display options Allow limited access to subsets of articles Control the life-time of articles to ensure relevancy Provide good search capabilities and crossreferencing options Store multiple document formats
Design Choices
Store articles in native XML database Article content stored against a subset of XHTML strict DTD easy to display and construct Each article has a meta-data XML file for owners, dates, related articles, number of reads, etc Article display via XSLT for HTML and pdf Article maintenance via jsps and custom tag libraries tech lounge
Controller servlet
Auth Task
Form Parser
Article Bean
mainframe
XML store
Useful Tools
Many things from Apache DHTML Graphic designer Created Tools/utilities Tamino Wrappers abstraction layer UID (QUID-like foreign key generator)
Problems/Mistakes
Not using CVS well during first half of project Not writing unit tests Not using logging for debug messages
Evolution
Display of XML moving towards all XSLT JSP usage moving away from interlinked pages towards controller server style JSP structure scriplets bad, custom tags good(?) Building up institutional tools/utilities and standards that are increasing productivity Individual experts towards wide spread Java use through in-house training courses
Other projects
PdaParser code generation to ease communication with mainframe modules Fatcookie authentication Virtual File System extension to JEdit to work with our unix server script editing proceedure Current Jar management database (entirely XML/XSLT) Web service wrapper for mainframe modules Dynamic pdf generation from mainframe data
Questions?