From: Keith D. <kd...@cs...> - 2004-05-31 19:38:55
|
Our in-development, swing-based rich client framework (spring-rcp) now has its first sample app! The application is a Pet Clinic; in fact, it works with the original Pet Clinic-Web's domain layer directly. Right now it is just a start and very basic, but it does illustrate the foundation APIs in play, as well as the configuration metadata needed to layout the GUI. I will continue to enhance the sample to more accurately mirror the PetClinic-Web use cases, particularly to illustrate new rich-client concepts, advantages, and features as they are introduced. Specifically, here is a feature highlights breakdown: - An application splash screen, configurable in a Spring application context. - Centralized action definitions, as well as action contribution policies to menus and toolbars are configurable in a Spring application context. Locale-specific properties, such as labels, mnemonics, accelerators, and icons are pulled from Spring message / image sources. The visual representation of an action is clearly separated from the functional command object; support for dynamic, context-sensitive commands is provided. - Page and view definition is configurable via a Spring application context. The framework handles loading application views and laying them out on the application page, registering local action handlers with global actions when a particular view is activated. - A wizard framework that makes it easy to build step-by-step input forms supporting a use case. The use of the template method pattern captures wizard workflow in super-classes, similar to Spring's Web-MVC framework, substantially reducing the amount of code you have to write. - A rich as-you-type validation framework built on the in-development declarative validation API (which is based on interfaces.) Validation rules can be declared external to the code and associated with bean properties. Bean binders handle binding text field input to the backing domain objects automatically, testing defined validation rules on user input. Sophisticated validation reporters are capable of reporting on rule violations with zero coding required - just define the rules and the message resources used for display. - Integration with jgoodies-forms for creating and laying out professional looking forms quickly. We provide an enhanced component factory API as well as a simplified, interface-based abstraction around JGoodies form builders. - Leverage of Spring's core infrastructure where it makes sense. For example, the framework makes heavy use of the beans infrastructure as well as the bean factory hooks. For example, the "application object configurer" bean post processor substantially reduces the amount of configuration information you need to specify to configure labeled objects consistently in the GUI (treating configuration as a separate concern.) In general, we want to find creative new ways to leverage the core. To launch the application, you'll need to do the following: 1. If you're using Eclipse and have already checked out spring and spring-rcp as projects, just run the "PetClinic.java" class in org.springframework.rcp.samples.PetClinic as a Java Application. Or, from ant: You'll need both spring and spring-rcp checked out from CVS at the same directory level. 1. Build spring.jar - "build alljars" from spring's root module directory. 2. Build spring-sandbox.jar - "build sandboxjar" from spring's root module directory. 3. Build spring's Pet Clinic Web - "build build" from spring's petclinic sample root directory (spring/samples/petclinic) 4. Build spring-rcp.jar - "build alljars" from spring-rcp's root module directory. 5. Launch PetClinic Rich Client - "build run" from the pet clinic rich client sample root directory (spring-rcp/samples/petclinic) You'll know when things are working when you see the splash screen appear, followed by the main application window. I certainly want to make the app web-startable ASAP. If anyone would like to help with this, let me know! Some stats: - So far the simple sample app is about 400 lines of UI and Controller code total; pretty good I think given swing apps have a bad reputation for generating tons of code. And much of that code is simple, concise stuff (each file on average has about 100 lines); like setter definitions for configuration, or hook-methods that do one thing. Although, I'm sure we can still do better. I'm always looking for ways to reduce LoC. As always, we very much value and encourage your feedback! The framework still has some way to go for release candidate form, but this is a definite milestone for us! I appreciate the patience of those who've been waiting for a sample! Sincere regards, Keith |