• No results found

Rapid Application Development. and Application Generation Tools. Walter Knesel

N/A
N/A
Protected

Academic year: 2021

Share "Rapid Application Development. and Application Generation Tools. Walter Knesel"

Copied!
43
0
0

Loading.... (view fulltext now)

Full text

(1)

Rapid Application Development

and

(2)

Java...

A place where many, many ideas have been tried and discarded.

A current problem is it's success: so many libraries,

so many technologies, so many choices

(3)

WEB Project DNA

● IDE (Eclipse, NetBeans, Jbuilder, IntelliJ, ...) ● Build Tool (Maven, Ant, …)

● Unit testing (Arquillian, EasyMock, JUnit, ...)

● App server (Tomcat, JBoss, WebLogic, WebSphere, Netty, ...) ● UI framework (JSF, GWT, Spring MVC, Struts, Tapestry, …) ● CSS files, JavaScript files, Images, HTML files, SQL

● View JavaBeans, Business JavaBeans, WebService endpoints ● ORM, DAO (JPA, Hibernate, JDBC), WebService clients

(4)
(5)

Java takes too long:

develop / compile / deploy / test cycle is long

IDE / project integration mysteries

download / config jars into IDE / app server

XML configurations are tedious (older spring /

hibernate)

Technologies change every darn time

(6)

So what did we do about it?

Rapid Application Development !

(7)

AppFuse 3.x

● open-source Java EE web app framework ● designed for quick, easy development start up

● Provides project skeleton and additional code features ● Maven 2 build automation

● Hibernate, iBATIS or JPA as persistence frameworks

● compatible with JSF, Spring MVC, Struts 2 or Tapestry frameworks ● Uses Netty web server

● http://appfuse.org

Some of the Code Features:

● User Management – login, signup, remember ● E-Mail

(8)
(9)

Grails

● Re-use technologies like Hibernate and Spring under a single interface ● Templates using GSP (Groovy Server Pages)

● Dynamic tag libraries for creating web page components ● Customizable Ajax support

● sample applications that demonstrate the framework ● includes a web server and automatic reload of resources ● http://grails.org/

Features

● No XML configuration

● All required libraries present

● Automatically prepares the Java web environment for deployment ● provides dynamic methods (mixins) based on class type

● allows developers to perform operations without implements or extends ● Has an app generator, owned by Spring Source, works like Spring Roo

(10)
(11)

JSPX(-bay)

● asp.net like imitator, yet different ● Does not mix java into jspx pages ● Plain html use – page tags

● convention over configuration ● stateful ui interface

● Data persistence exists, JPA not mentioned

(12)
(13)

OpenXava

● You write the code for data structure and business logic

● You do not have to write HTML, JavaScript, CSS, SQL, etc. ● Java EE user interface and the database logic are

automatically provided

● Extend any part of the app later, if needed

● List mode (search) has paging, ordering, filtering, adding /

removing / moving columns, PDF reports, export to Excel, etc.

● Detail mode (view) with tabs, frames, dialogs, editors for

(14)
(15)

Play 2.x

● Definite Scala web platform possibility

● Scala and Java, non Java EE

● heavily inspired by and similar to Ruby on Rails and Django, uses module concept ● Uses convention over configuration

● designed to be run using JBoss Netty web server ● Can package to war and run on EE app servers.

● Stateless: Play 2 is fully RESTful - there is no Java EE session per connection ● a persistence layer based on JPA

● Built in hot-reloading ● an embedded database

● full embedded testing framework ● http://www.playframework.com/

(16)
(17)

WaveMaker 6.x

● Automatic generation of Hibernate mapping, queries from database

schema import

● Automatic creation of Enterprise Data Widgets based on schema import

● Edit form implements create, update, delete functions automatically

● Visual, drag & drop assembly of web applications

● Developer sees live application data within the studio (LiveLayout)

● one-touch deployment to Tomcat, Websphere, Weblogic, Jboss

● Browser-based WaveMaker studio can be bundled

● Deploys a standard Java .war file

● effectively an open source alternative to Force.com

(18)
(19)

Others not covered

● Jrapid, not free, cloud based, DRY

http://www.jrapid.org/

● Stripes, not specifically RAD

http://www.stripesframework.org

● Vaadin, not specifically RAD

https://vaadin.com

● Wicket, not RAD, plain html, components

(20)

Common Features

● Project skeletons and some feature code

● Convention over configuration and Annotations ● Maven – get / configure / deploy jars

● Maven – standard project config, operations ● light-weight frameworks, scripting langs

● DRY (don't repeat yourself) pattern

(21)

Another Approach Please?

I don't really want to give up my

environment for another

The technology changed again and I don't

want to jump to yet another environment to

catch up

(22)

Application Generation Tools

● Not as easy as pushing a button

● Does not generate a production application

DOES generate a deployable running application

● A good start, delete what you don't want ● Grails

● Maven archetypes ● Spring Roo

(23)

Maven Archetypes

● Many choices, will likely find one for your desired

environment and version.

● Built a demo with

jboss-javaee6-webapp-archetype 7.1.3 Final

● Command line: mvn archetype:generate

● Eclipse new → maven project

● Produces a maven project skeleton

(24)
(25)
(26)

Maven Archetypes

Pros

● Part of Maven, instant Maven project

● Light, quick, easy to run

● No other external software to install

● Freedom to build app your way

● Many, many archetypes to work with

Cons

● Produces a skeleton only

(27)

Spring Roo

Is a separate (commandline) generator

Has to be installed (unzipped)

Install oracle driver into internal osgi

Reversing a database worked first try!

Had to build database tables first

(28)
(29)

Roo commands

● project --topLevelPackage org.cchmc.bmi.psysoc.pvp ● jpa setup --provider HIBERNATE --database ORACLE

● dependency remove --groupId com.oracle --artifactId ojdbc14 --version 10.2.0.2 ● dependency add --groupId com.oracle --artifactId ojdbc6 --version 11.2.0

● database properties set --key database.driverClassName --value oracle.jdbc.OracleDriver ● database properties set --key database.url --value jdbc:oracle:thin:@localhost:1521:XE ● database properties set --key database.username --value myid

● database properties set --key database.password --value mypass

### all tables at once

● database reverse engineer --schema PSYSOCPVP --package ~.models

● web jsf setup --implementation ORACLE_MOJARRA --library PRIMEFACES --theme BLUESKY

### build them all

(30)

Roo

Generated:

● a PrimeFaces JSF UI

● Non EE AspectJ Spring beans and models

● heavy use annotation and injection

● Models use JPA

● Some internationalization provided

(31)
(32)
(33)

Roo

Pros

● Little investment

● More capabilities than shown

● Database schema reversal works

● Spring, JPA, JSF, PrimeFaces

Cons

● Non EE

● AspectJ bean generation

● Roo Specific Annotations

(34)

Seam 2

● Marry JSF 1.2 w/ JPA and make it work

● My first app generation encounter ● Installed Seam external to IDE

● Defined schema in reveng.xml

● Built an EE 5 CRUD app

● MPM admin tool started this way

(35)

Seam 3

Java EE 6 and CDI

Seam 2 had to become Seam 3

Seam 3 introduced JBoss forge

Seam 3 has stopped (see Apache

DeltaSpike, others)

(36)

Jboss Forge 1.4x

Is a separate (commandline) generator

Has to be installed (unzipped, Eclipse)

Reversing a database - miserable failure

Did it their way, inside out

(37)
(38)

Forge Commands

● New-project;

● scaffold setup --scaffoldType faces;

● beans setup;

● entity --named Customer --package ~.domain; ● field string --named firstName;

● field string --named lastName;

● field temporal --type DATE --named birthDate; ● …

● @/* Generate the UI for all */;

● scaffold from-entity ~.domain.* --scaffoldType faces –overwrite;

● @/* create rest WebService CRUD endpoints */; ● rest setup;

● rest endpoint-from-entity ~.domain.*;

(39)

Forge

Generated:

JSF UI

Domain beans, EE criteria query view beans

heavy use annotation and injection

views use JPA

(40)
(41)
(42)

Forge

Pros

● More function, for free

J2EE 6 Annotated, JBoss compatible, what we use ● JSF, JPA, criteria queries already built if desired ● Large table paging is built in.

Cons

● Multiple injected entity managers ● Extended conversations

● More pages, clicks to navigate

● Want DB reverse engineering to work ● View beans are too dense

(43)

Conclusions

Generally good starts or short cuts

Use what works, delete what doesn't

May show new ideas, techniques, APIs

Build multiple projects, cannibalize them

Don't be afraid to modify / extend

References

Related documents

Alternatively, if you choose to install the BAM server on a machine where JBoss, Tomcat, WebLogic, or WebSphere application server is installed, you must manually create the

• Determining the Right Paid Leave Program for Your Organization • Structuring a Paid Leave Program to Help Prevent Leave Abuse • The Interplay of Mandated Paid Leave and Voluntary

than the rights of the parties addressed in Day,” and the Court ultimately deferred to the Texas Supreme Court to “recognize and pronounce such. an expansion” of the holding in Day

The purpose of this dissertation is to develop and implement a seminar to improve some of the major problems that alter or disrupt immigrant family relationships between spouses

Figure 14 shows the temperature variation for thermocouples 1 (middle of upper clad surface) and 8 (specimen flank at deep crack tip) for the period of the fracture test and

Even though individuals in the system perceived deterioration in the quality of their communication with those that received the developmental coaching intervention, the more

Therefore, by default, a pcap trace file created as a result of enabling tracing on interface 1 of the Ipv4 protocol of node 21 using the prefix “prefix” would

3) Chaotic iterations and Devaney’s chaos: In this sec- tion we give outline proofs of the properties on which our secure data hiding scheme is based. Using chaotic iterations