What is Structs And Nodes Development (SAND)?
Structs And Nodes Development (SAND) is a form of message-oriented modeling and development that declares application data (structs) and application processing components (nodes) as java classes supplemented with custom javadoc tags. Runtime processing centers around synchronous and asynchronous messages (generated from the struct definitions) which are sent between executing application components (generated from the node definitions). The majority of the application code is generated automatically.
SAND explicitely addresses the following application design concerns:
Links to additional information:
Sandev is a complete Structs And Nodes Development (SAND) framework generator implemented using Ant, and targeting an Apache/Tomcat deployment environment. Sandev grew out of the sandboss project, which was substantially similar but targeted the JBoss application server. The sandev project serves as a reference framework generator implementation.
Sandev can be downloaded from sourceforge
What is a framework generator?
A framework generator is a build tool that reads declarative application definitions and produces a complete framework of supporting technology interfaces through code generators.
A SAND framework generator (like sandev) reads source code written in accordance with Structs And Nodes Development declarations, and writes the code needed to support persistence, ad-hoc queries, object serialization, request marshalling, asynchronous notification, UI form rendering, UI form processing, error handling, logging, runtime instrumentation/control, deployment configuration, build coordination and other utilities.
Unlike traditional approaches, which consist of layers of abstraction that never completely map to your application definition, a framework generator works from your application definition to build the code that calls supporting technology APIs.
See FrameworkGenerators.html for overview information.
For more information on advantages, see the scenarios.
What problems does SAND address?
For more information on advantages, see the scenarios.
What are the benefits of Structs And Nodes Development?
Feature Benefit
- Message oriented architecture
- Directly models business dataflow
- Fine grained authorization, support for cascading firewalls
- Time tested, flexible approach
- Data structures and processing modules defined in standard java (j2sdk1.4+)
- Reduced complexity without proprietary tools
- Unified data and processing model embedded in source code
- Application data and logic not bound to support technology
- Single source for data and processing module definitions
- Code generation framework
- Supporting technology interface generators (persistency, messaging, format conversion etc) can be re-used across applications
- Cross-cutting system concerns (security, auditing, documentation etc) leverage consistent data and processing declarations
- Huge effort savings leveraging existing generators
- Modular project structure
- Projects can require other projects to re-use existing functionality and/or common definitions
- Multiple deployments of a single application
- Multiple applications in a single deployment
- Openly published methodology, open source tools
- Portable methodology with no lock-in or licensing fees
- Can be extended to work with other models, technologies, software and tools.
What are the benefits of sandev?
Feature Benefit
- All open source with minimal prerequisite software.
- Default implementations can be used over a wide range of technologies (within or outside of J2EE).
- Minimal setup and system requirements.
- Full access to development source code and mailing lists.
- Zero cost
- Comprehensive Ant build with generator infrastructure and dependency checking across required projects.
- Supports large scale dependency-checked code generation.
- Code generation integrated into fast incremental build.
- Simple initial setup and low maintenance.
- Modular application component structure with consistent physical source layout.
- Fully navigable documentation web spanning entire project dependency graph.
- Easily extensible.
- Common
basicsproject defines
- Message type hierarchy and messaging technology interfaces
- Authorization and security infrastructure
- Persistence management and caching
- Test script messages and driver infrastruture
- Utilities for reference resolution, UI form processing, matching, logging, serialization, conversions and more
- Most of the core framework your application requires is already written and tested
- Deployment ConfigurationStruct included in
basicsproject.- Integrated deployment configuration editor.
- Defines which nodes are running on which servers with what initial parameter values.
- Defines application-wide communications in terms of custom application data and custom application business logic modules.
- Defines initial data that must be present at system startup.
- Separate deployment configuration editing tools not required.
- XHTML persistence format supports version control and other editors.
- SandUIStruct included in
uiproject.- Integrated SandUI editor.
- Standard MVC architecture is easily understood and extended.
- Form support for each struct definition provides ad-hoc queries, multi-instance listing display, add, modify, delete, navigation across references, subclass resolution, custom report displays, custom action buttons, context sensitive help.
- Authorization processing uses same action, instance, field and field value as internode communications, ensuring a smooth user experience within a muli-level security model.
- Default webapp support based on standard XHTML/XSLT ensures simple customization of look-and-feel.
- Technology independent, declarative UI definition can be adapted to multiple display technologies.
- XHTML persistence format supports version control and other editors.
- Easily extensible/replaceable.
- Integrated control infrastructure.
- Standard and dynamic JMX MBean wrappers generated for each node declaration.
- Generated control panel provides click-through access to each node's native control panel interface.
- Control framework supports multiple simultaneous control interfaces.
- Easily extensible.
- Integrated optimized messaging.
- Supports integrated synchronous (invocation model) and asynchronous (pub/sub model) communications.
- Messaging uses direct method invocation for nodes running in the same VM.
- Fully integrated authorization model supports filtering, secure communications, auditing and other communication hooks.
- Full trace capability and remote/local exception handling.
- Includes optimized XML serialization/reconstruction.
- Support for application-defined transactional boundaries.
- Protocol-agnostic generator framework can support custom:
- messaging protocols (either standard or vendor proprietary)
- encryption protocols
- auditing requirements
- serialization/reconstruction standards
- Integrated persistence support.
- Default implementation using standard JDBC.
- Automatic support for transaction-safe, version-tracked, field-validated persistence.
- Automatic support for ad hoc queries.
- Automatic verification of data structures (schema creation and maintenance, initial data verification and maintenance)
- Supports struct inheritence (data definitions extended from a common base).
- Automatic pluggable primary key management with support for alternate keys.
- Pluggable class/field mappings and value conversion.
- Minimal overhead and complexity.
- Easily extensible/replaceable.
- Sample
TaskHeapapplication andTaskHeapDemodeployment
- Provides a working example application for development reference
- Can be used for development task tracking and planning
- Pluggable technology interfaces
- Adapt to multiple control, messaging, logging, and persistency implementations without impact to core application source
- Globally consistent statistics and testing infrastructure
What do I need to change to use SAND?
Structs And Nodes Development has two primary requirements:
struct declarations to define data, and node
declarations to define processing modules. Switching to code generation is easy, and gets rid of all the tedious work that nobody in their right mind wants to do anyway. Switching to structs is also easy, but can be more of a paradigm shift. Most organizations model their data starting from either
structs. Switching to nodes may also require a
shift. If you are familiar with data flow, or you are committed to SOA,
then message-oriented modeling and development using SAND will make sense
to you. Otherwise this is going to require some background on distributed
enterprise application development.
In typical development, the technology is chosen first and then the implementation is done. Really the requirements of the application should determine the technology, especially as both the technology requirements, and the supporting technology itself will evolve over time. Structs and Nodes Development provides a basis to define the application requirements without having to commit to a specific technology first. Unfortunately this freedom is not what people are used to. Changing to SAND may require a shift in perspective.
If your organization is already using an abstract modeling tool with sufficiently general data definition capabilities, and that tool has generator capabilities, then it may be possible to generate SAND definitions from it. If not, it is usually possible to generate source for the modeling tool from the SAND definitions.
Where does that 80% figure come from?
In our TaskHeap demo deployment, under 15% of the core application was custom code, and nearly 80% of the total java source was autogenerated. This is a small app, but we expect at least the code generation ratio to remain relatively constant.
There's a lot of grunt work in creating a custom application. If it's possible to write a program to write the code, then we write it.
What level of technology does sandev provide?
The default technology implementations in sandev are completely original implementations developed without reference to any other existing source code. They are built based on our general experience (going back to around 1986), and common computer science techniques (going back way before that). The fundamental theories and practices this work is based on have been around since the late 70s.
If we define "generation" to mean the number of times the development lead on a particular technology has implemented something similar before, then this is a rough breakdown of the sandev component technologies that ship with the open source release:
Everybody has dealt with logging, exception processing, system build, deployment, documentation and other utilities for every project they've worked on, so it doesn't make sense to describe these in terms of technology generations. The sandev environment supports all the mod cons.
What are the stages of enterprise application development?
There are three major stages of enterprise software development:
There is nothing wrong with being a stage 1 organization. The advantages of the later stages grow as the pain associated with managing application islands increases. Clearly if you only have one primary enterprise application, then integration is not much of an issue and setting up a common architectural basis will not be your first priority. At this stage SAND is useful for the generators, and the visibility provided into the enterprise application.
At stage 2, SAND provides the same advantages as stage 1, but shifts the focus from point solutions to integrated solutions. The required goals are achieved, while enabling enterprise communications to grow. With a common architectural basis, enterprise applications can be added as needed, without the enterprise becoming mired in an exponential growth of point solutions, or committing to a single integration technology.
At stage 3, enterprise development is usually quite customized. SAND was built to work at stage 3, with the understanding that the organization will create or customize their SAND generators based on their unique requirements. At this stage, SAND provides a framework for enterprise application development.
Can SAND work with existing applications?
Yes. As with any integration effort, you will need to write adaptor code, so this is really two questions:
While the answers to these questions depend on the situation, you do not need to rewrite or change any existing code to use SAND. In general, you need to
There is a huge range of approaches, mechanisms, tools, and technologies for adapting existing applications. All those that we know of are compatible with the SAND methodology.
The primary goal of the sandev project is to serve as an example of how to build a Structs And Nodes Development framework generator, and to provide default reference information for general use.
A secondary goal of sandev is to provide a smooth migration path from stage 1 enterprise application development up through stage 3, without requiring additional specific technologies or frameworks. The Structs And Nodes Development methodology, coupled with the code generator infrastructure and existing codebase, provides for extremely rapid and flexible application development (aka SANDRAD).
A third goal of sandev is to illustrate how SAND works, specifically:
How does SAND/sandev compare to MDA?
Model Driven Architecture (MDA) uses a UML model of the application to generate code. More specifically a platform independent model (PIM) drives a platform specific model (PSM) through code generation. Changes to the system are done through changing the model, which is separate from the generated code. Changes to code are not reflected in the model.
SAND does not use a separate model hierarchy to generate code. The emphasis is on iterative application definition and repeated code generation. The source code and the application definition are one and the same.
How does SAND/sandev compare to AOP?
Aspect Oriented Programming (AOP) and a framework generator are overlapping solutions derived from different perspectives. Both work from a definition to produce code in accordance with a pattern, and a complete application framework is equally valuable whether generated via AOP, or a framework generator, or both. A framework generator can easily work with AOP thanks to the output of a code generator being indistinguishable from handwritten source.
A framework generator is first and foremost a generator, which means it runs before code compilation. That distinguishes it from runtime interpretive techniques (such as reflection, runtime metadata discovery, XML data parsing etc), and from post-compilation modification techniques such as bytecode manipulation. These techniques are also important, and increasingly a part of application processing and platform deployment, but they are distinct from framework generators based on when they do their work.
The goal of a framework generator is to produce an application with all the advantages of being handcoded from scratch (such as compiling to a native executable, easy debugging etc).
How does SAND compare to SOA/Agents/EJB?
Structs And Nodes Development (SAND):
SAND separates application code from supporting technology code, allowing both to be implemented more effectively.
I'm already using a code generator. How's this fit in?
A code generator is anything that automatically writes source code. Code generators range from scripts or wizards that are run once, to sophisticated software tools integrated into the iterative build process, that write all the code necessary for a major portion of an application (a common example is persistency). Because the advantages of code generation are compelling (implementation consistency, capture and refinement of programming knowledge etc), many large scale application development efforts use at least one code generator, and many use several. Once a development effort is running multiple generators, their use needs to be coordinated. Once several code generators are coordinated in a build, that build becomes a framework of generators.
As a framework of generators grows in complexity, several points begin to emerge:
Addressing these points results in an integrated collection of generators, all working from a common definition of application data and functions. This integrated package is a framework generator.
Aren't message-oriented systems slow?
Messaging communications in SAND are defined independently of the transport mechanism. That allows us to use direct method calls for local communications whenever possible. That (and years of experience building a broad range of messaging applications) allows us to build tightly integrated, high performance systems with all the flexibility of a message-oriented architecture.
Our transport independence allows us to work across a variety of technologies (or combinations of technologies) to achieve an appropriate balance of speed, flexibility, and external visibility. So you can choose between web services, various JMS vendors, proprietary messaging protocols, or combinations of these as appropriate.
Does SAND work with JavaSpaces?
Yes. But it doesn't currently use them. A JavaSpace is a Jini service with semantics similar to a cache:
In a SAND application, components generally react to receiving messages, and reference their own copies of any information they need. Updates will only succeed if they reference the most recent information, with transactional integrity guaranteed by the DataManager. So any data in a SAND application's JavaSpace must be managed by the application to ensure it is only accessed through the space semantics.
At the time of this writing, the plan is to leave JavaSpaces out of the main SAND framework, so that applications are free to use JavaSpaces as they see fit without any potential interactions or increased complexity.
Where do I make changes in a SAND app?
The dirmap.html file in the top level docs provides a component overview. You generally only need to make changes to the "custom application code".
Advanced development involves using generators to create new technology interfaces, new tools, or even a new SAND platform. However we strongly recommend getting your app running on the existing platform first.
Use the SandUI editor to define the screens, links and actions that make up the UI. Implement your UIFormOwner node to handle the data processing. Modify the templates to make the display look nice.
How does the SAND UI processing happen?
The SandUIAdaptor calls UIScreenAdaptor.getScreen to retrieve a working copy of the current screen. UIScreenAdaptor loads the formState for each link by calling UIFormAdaptor.getFormContext. When the screen has been reloaded, each UIFormContext action is either CUSTOM, one of the standard form actions, INIT, or UNDEFINED.
The SandUIAdaptor then processes the screen by walking the links and processing each one if necessary:
Some standard form processing may affect data references, in which case UIFormOwner.doAction(ACTION_REFRESH_GLOBAL_DATA,...) is called for each link to allow the references to be updated. If you have multiple forms on a single screen, where updating one form affects the contents of another, then you need to implement this action handler. Otherwise the form that handled the action is already up to date.
JBoss is a trademark of Mark Fleury under operation by The JBoss Group, LLC.
Java, EJB and J2EE are trademarks of Sun Microsystems, Inc.
Other company, product and service names may be trademarks or service marks of others.
The original Structs And Nodes Development documents are published on epinova.
© 2002-2006 SAND Services Inc.
All Rights Reserved.