Statement driven development

Today most methodologies used model oriented approach.
It can be domain-driven or reverse-engineering, one common point is that they start from a static definition of a model. For domain-driven, it is the domain issued by the development language itself. For the reverse-engineering it starts from a static model structure definition ex: a xsd, wsdl, database schema. 
Statement driven development focuses on the actions the developer can run on some models and not the models themselves.
 Example: a select statement fetching all the group members a user with group-administrator-role can manage.
 Here the statement can be materialized into a search query with sql as implementation.
The important thing for the developer is the query and its I/O not really the underneath model and … not the decorative technology.
Why Statement-Driven-Development
Couple of articles and limitations make me think that statement driven approach can be a flexible and fast alternative for developpers.
Usually after defining an abstract model such as ORM, the user have to write his UC statements. This means that there is still this second step to perform.
The model is sometimes/often overkill. As a developer, you do not have to apprehend the entire model complexity before yielding productivity.
Limitation on standard 
Like in the JOOQ article about function and stored procedure extracting the meta-information can reach some limits when entering in vendor specific particularities.
Native DSL 
There is a trend that states that SQL is the only DSL you need.
Why should you wrap it with other technology abstraction that limit its power?
Bye-Bye Domain Objects 
…Welcome DTO. 
I/O are by essence DTO (why should they be the exact reflection of a persistence layer?). This situation is just a specific exception. 
This exception is widely used by multiple apps/framework (strong resuability but limitations).
 Remark: This article is not there to cover the ‘everlasting-debate’ DO vs. DTO. SDD just brings a new approach that do not exclude but complement the DDD/Rev-Eng one.  
Concretely 
MinuteProject for release 0.8.1+ (mid-may-2012) will offer Statement-Driven-Development facilities.
  • The user will focus one SQL statement.
  • The output will be deduce by the execution of it.
  • The input will be easily configurable.
Example 
Here is a simple configuration. Statement-model is the new node.
  <model>
    ...
      <statement-model>
           <queries>
               <query name="get address street">
                  <query-body><value><![CDATA[select * from address where addressid > ?]]></value></query-body>
                  <query-params>
                      <query-param name="identifier_Address" is-mandatory="false" type="INT" sample="1"></query-param>
                  </query-params>
               </query>
           </queries>
      </statement-model>
  </model>
This configuration should be enough to get:
  • Input bean
  • Output bean
  • Output list bean
  • All the technology decoration ex for REST CXF:
    • Resource bean with REST path
    • spring config
    • Native DAO
Demonstration will be shipped in Minuteproject next release (0.8.1).
Integrating with REST is pretty much statement-driven: basically you just need to know the URL + its I/O.
Conclusion
 
  • With SDD you focus on the statement and the I/O.
  • Minuteproject simplifies the rest (technology wrapper).
Reference: Statement driven development from our JCG partner Florian Adler at the minuteproject blog blog.

Do you want to know how to develop your skillset to become a Java Rockstar?

Subscribe to our newsletter to start Rocking right now!

To get you started we give you two of our best selling eBooks for FREE!

JPA Mini Book

Learn how to leverage the power of JPA in order to create robust and flexible Java applications. With this Mini Book, you will get introduced to JPA and smoothly transition to more advanced concepts.

JVM Troubleshooting Guide

The Java virtual machine is really the foundation of any Java EE platform. Learn how to master it with this advanced guide!

Given email address is already subscribed, thank you!
Oops. Something went wrong. Please try again later.
Please provide a valid email address.
Thank you, your sign-up request was successful! Please check your e-mail inbox.
Please complete the CAPTCHA.
Please fill in the required fields.

Leave a Reply


7 × = seven



Java Code Geeks and all content copyright © 2010-2014, Exelixis Media Ltd | Terms of Use | Privacy Policy | Contact
All trademarks and registered trademarks appearing on Java Code Geeks are the property of their respective owners.
Java is a trademark or registered trademark of Oracle Corporation in the United States and other countries.
Java Code Geeks is not connected to Oracle Corporation and is not sponsored by Oracle Corporation.
Do you want to know how to develop your skillset and become a ...
Java Rockstar?

Subscribe to our newsletter to start Rocking right now!

To get you started we give you two of our best selling eBooks for FREE!

Get ready to Rock!
You can download the complementary eBooks using the links below:
Close