Skyway Builder 6.3 includes some enhancements to the Spring DSL.  In previous blog posts, Jack Kennedy discussed our Spring DSL in Skyway’s “Perspective” on Software Generation, and Mike Weaver provided an overview of Customizing the Code Generation Process.  I thought I would take this opportunity to describe the Spring DSL from the perspective of a developer using the Spring DSL to create Spring applications fast…..very fast.

The Spring Framework is one of the most popular Java frameworks.  While the Spring Framework and associated Spring technologies reduce complexity, developing Spring applications still requires familiarity with Spring development concepts and configuration.  This represents a significant learning curve for developers who are just getting started with Spring development, and experienced Spring developers just want it all to be easier.  Our Skyway Builder solution provides an abstraction layer on top of Spring that generates Spring-based artifacts and configuration files according to Spring best practices.

The abstraction is accomplished by employing an EMF-based metadata model to capture the specifications from the developer, which in turn drives the code generation process. For defining the specifications, Skyway Builder provides Eclipse-based tooling which includes the use of editors, wizards, and modeling artifacts. The Skyway Generation Framework then converts the metadata into generated code and Spring application artifacts.

Skyway Builder implements a DSL for Spring that describes all the major components of a Spring application. Application development using Skyway Builder is accomplished by using (assembling and configuring) Spring DSL artifacts.  The Spring DSL artifacts have direct correlations to one or more Java, Spring, JPA, and JEE artifacts.

metamodel5

Here’s an overview of the Spring DSL model:

  • Projects are the top-level artifact within the developer’s workspace. All other Spring DSL artifacts must be made within a Skyway modeling project.
  • A Model Package is a Spring DSL artifact for namespacing and grouping related Spring DSL components. A model package can contain any top-level Spring DSL elements, including other model packages. Model packages correlate directly to Java packages (and UML packages), and Spring DSL artifacts created in a model package will be generated into a matching Java package.
  • A Domain Object is a Spring DSL artifact that defines the domain model of the application. By default, a domain object is generated into a plain old Java object (POJO). If a domain object is associated with a data access object, then the domain object is annotated as an @Entity (JPA) annotated class, and it’s associated with a primary key class (@IdClass). Fields can be added to domain objects by using the basic data types, and a domain object can have relationships to other domain objects.
  • A Data Access Object (DAO) is a Spring DSL artifact used to separate data access logic from application logic. A DAO manages the persistence of domain objects, and it is generated into @Repository annotated Spring components, a specialized stereotype for data access layer components. A DAO can also contain predefined queries called Named Queries.
  • A Named Query is a Spring DSL artifact creating predefined queries for the data access objects (DAOs). Named queries are defined using either SQL or JPQL (Java Persistence Query Language), and Named Queries are generated into @NamedQueries and @NamedQuery annotations in Spring @Repository components.
  • A Service is a Spring DSL artifact that defines a service layer component, and it gets generated into a @Service annotated Spring component, a specialized stereotype for service layer components. A Service contains a set of Operations which are generated into Service methods.
  • A Web Controller is a Spring DSL artifact the defines the web layer of an application using Spring MVC. Web Controllers get generated into a @Controller annotated Spring component, a specialized stereotype for web layer components. A Web Controller contains a set of Operations which are generated into methods for handling web requests.
  • An Operation is a Spring DSL artifact that defines methods for both Services and Controllers. Operations represent application logic, and they use inputs and outputs for exchanging data. Operations are generated directly in the respective Service and Controller classes, and they are generated slightly differently to account for the different implementations needed for the Spring stereotypes.
  • An Action is a Spring DSL artifact for implementing operations using model-driven development. They are used to implement service and controller operations in Java using drag-n-drop steps that are sequenced together into functionality.
  • A Component is a Spring DSL artifact that defines a generic container for data. A component gets generated into an @Component annotated Spring component, a generic stereotype for Spring managed components with configurable scope. Components are typically used as data transfer objects (DTO) and form backing objects.
  • A Flow is used to implement the web layer of an application using Spring Web Flow.
  • Java Server Pages (JSP) are used to implement the Presentation layer of an application. JSPs are used for both Spring MVC and Spring Web Flow applications.
  • An Exception is a Spring DSL artifact that defines custom exceptions. Exceptions are generated into exception classes in Java.

Please remember that this is a feature preview.  Skyway Builder 6.3 should be available near the end of August.  To stay in the loop on the upcoming 6.3 release, please follow us on Twitter, become a fan of Skyway Builder on Facebook, or join the Skyway Community. As one of the many benefits of joining our community, you will automatically receive product announcements and updates.

Skyway Builder 6.3 Feature Preview Series

    Bookmark and Share

    Tags: , , , , , ,

    Leave a Reply