-
Notifications
You must be signed in to change notification settings - Fork 6
Second Tutorial Part 1: Compile Time Java Code Generation
Previous | Main | Next |
---|---|---|
Main | Part 2 --> |
In the First Tutorial, we explored the modeling capabilities of Tilda and the ability to iteratively define tables and complex views. For some projects, this may be all you need to do: maintain a rich schema, produce documentation, enjoy automated iterative deployments with automated migrations. This is a simple way to use Tilda with at the core simple managed SQL-based assets (DDL files). This is applicable for example for data warehouse projects or schemas in general where data population and access is done via tools (for example, an ETL suite such as Pentaho Kettle to populate the database and a reporting tool such as Tableau to display data).
For some other projects however, you may want to access the data through an application, for example, a Java-based Web application. In that respect, Tilda is similar to other frameworks such as Hibernate or MyBatis, but with some key differences:
- Tilda is model-driven from the start as illustrated by the First Tutorial.
- Tilda generates transparent Java-based assets that do not obfuscate your model or your SQL needs.
- Tilda can reverse engineer schemas and generate models, which in turn will be used to stand up Java applications.
- Tilda generates all your POJOs and JDBC wrapper code from the model: no need to write tedious access code to stand up an application against a model.
- Documentation and migration are built in from the start.
- Logging and performance monitoring are built in from the start.
- Tilda understands JSON or CSV and patterns such as "sync" and thus is a good solution for web services that manage sync'ed data sets from mobile or offline applications for example.
- Tilda generates compile-time artifacts which makes iterative development and model refactoring a natural part of the development process, aided with standard features of your favorite IDE and compiler.
In this tutorial, we'll cover the basic architecture of the Java code Tilda generates and how to use them, in particular:
- Reading and writing from tables
- Reading from views
- Methods of access via indices and queries
- Custom where-clauses
- Record Processors
- Servlet bindings
- Data export capabilities in JSON and CSV
- Custom queries
- Code customization with hidden fields and pre-write/post-read handlers.
We expect someone to take about 60mn to get through this 10-parts material, and an accompanying video that shows an actual development session. The parts are:
- Second Tutorial Part 1: Compile Time Java Code Generation
- Second Tutorial Part 2: Basic Scenario
- Second Tutorial Part 3: Reading And Writing Data
- Second Tutorial Part 4: Indices and Queries
- Second Tutorial Part 5: QueryHelper, JDBCHelper And Custom Where Clauses
- Second Tutorial Part 6: Record Processors
- Second Tutorial Part 7: Servlets
- Second Tutorial Part 8: JSON and CSV Export
- Second Tutorial Part 9: Logging And Performance Monitoring
- Second Tutorial Part 10: Behavior Customization
- Second Tutorial Part 11: One More Thing...
- Second Tutorial Part 12: One Last Thing...
We aim to demonstrate the power of Tilda and highlight through examples what we believe are the strongest points of the framework:
- The 'T' in Tilda stands for 'Transparent' and the SQL and Java assets it generates should be mostly obvious to someone who understands SQL and basic JDBC, but not critical in using the framework.
- The 'I' in Tilda stands for 'Iterative' and the development process supported by the framework encourages an agile approach to development:
- The Migrate utility automates many of the tasks that are typically handled by a DBA
- Tilda models are living breathing models
- The structure of how models are defined in JSON enable much more team concurrency in maintaining the model
- The compile-time nature of the generated code helps promote refactoring patterns key to iterative agile development.
- Tilda is performance-conscious and implements many patterns that can handle large datasets and drives JDBC APIs at the lowest level.
- Tilda is easy to adopt by a junior team of Java engineers with modest database skills.
We recognize that Tilda is a very young project and hope to also demonstrate that the risk of adopting it is low because all its assets are plain SQL and Java and could easily be used mixed in another environment.
You should have your development environment ready. See Getting Started.
- Have installed on your system Java, PostgreSQL, Eclipse and possibly Apache Tomcat.
- Have your Eclipse workspace configured and initialized with a base project.
- Have set up the tutorial project.
This second tutorial also builds upon the scenario explained through the First Tutorial and therefore, you should be familiar with it as well.