introducing exadel flamingo javaone, may 2008 igor polevoy: [email protected] [email protected]...
TRANSCRIPT
JavaCGI
Java Servlets
JSP
JSTL
Struts 1
WebWork
Tapestry
JSF
AJAX Fever:Scriptaculous
PrototypeDWR
Jqueryetc
A4JSF
RichFaces
SpringMVC
?
Struts 2
Wicket
MyFaces
Traditional Web Technologies Timeline(approximate)
Rich Web Technologies Timeline(approximate)
ActiveX
Java Applets
Adobe Air
Laszlo
JavaScript:
ScriptaculousPrototype
DWRJquery
etc
Flex
Google Web Toolkit
?
Silverlight
Case for Flamingo
• Demand for RIA• Crowded market in the area of traditional applications• Very interesting developments in RIA technologies
– Flex– GWT– JavaFX– Silverlight– ?
• None of the frameworks are comprehensive• Every project is unique: developers are left to put projects
together by hand each and every time, no consistency between projects
• Most solutions are just glue between server and client code and do not offer anything else
What is Flamingo?
• Integration Library
• Set of client side components
• Supporting tools
Flamingo Advantage
• Integration Library – very fast, uses binary protocols for communication
• Client Side Components– Drastically reduce amount of code (dynamic methods, binding, validation)– Allow for special cases where bundling is necessary (call set)
• Tools– extremely easy to setup– if new project created, it is configured automatically– allow for rapid application development; project creation, adding project artifacts
automated
• Bottom Line for Flamingo:– Fast time to market– Developers focus on business problem, not wiring– A lot less code to write– Projects look a lot like each other (same project structure)
Integration Library
• Only binary communication protocols are supported currently:– AMF – Hessian
• Binds directly to Seam components or Spring beans
• Almost no configuration is necessary
• If new project generated, so is configuration
• Main motto: it just works, do not focus on it!
Client Side Component
• Binding: allows to bind client UI components (text boxes, etc.) to server side components (Seam components, Spring beans)
• Validation: transparent use of use of Hibernate Validation framework. This allows a developer to use Hibernate validation rules (annotations) directly on user interface.
• CallSet: allows to bundle multiple client operations into one server call. This is great for transactions, efficiency, use of event-scoped components.
• Dynamic Persistent Methods: provide ability to dynamically specify simple queries on the client side as remote methods without having them implemented anywhere. Flamingo runtime builds queries on demand.
Flamingo Tools
• Code generation:– Projects– Services– Entities– Screens (CRUD)
• Tools future directions: – IDE integration for artifact generation, re-factoring– Dynamic scaffolding?
Flamingo Binding
1. Client side value object:var user:PersonVO;user = new PersonVO();user.firstName = "John";user.lastName = "Doe";user.city = "New York";
2. Binding Definition: <flamingo:SeamBinding
id="personBinding"destination="userBean" source="{user}" fault="faultHandler(event)" />
name of this binding
server component
name of local object
3. On event:personBinding.commit() //will commit changes to server componentpersonBinding.update() //will update local component from server
4. Supports complex object graphs
Flamingo Validatorbased on Hibernate Validator
import org.hibernate.validator.Length;..@Length(min=3, max=40, message=“Last name too short or too long”)
public String getLastName() { return lastName;}
<flamingo:EntityValidator id="validator"destination="{destination.text}"
validationTarget="{target.text}"source="{test}" property="text" required="false"/>
name of server component
name of server component property
UI component
UI component property
Flamingo CallSet
1. Define a call set<flamingo:SeamCallSet id="loginTest"
destination="callSet"result="loginTestResultHandler(event)"fault="testFaultHandler(event)">
<flamingo:SeamCall component="identity" method="setUsername"/> <flamingo:SeamCall component="identity" method="setPassword"/> <flamingo:SeamCall component="identity" method="login"/> <flamingo:SeamCall component="identity" method="isLoggedIn"/></flamingo:SeamCallSet>
2. Execute a call set
loginTest.send([username.text],[password.text],[],[]);
Flamingo Seam Conversation Support
• Full support of Seam conversations
• Easy to use in code
Seam Conversation
Client:<flamingo:SeamRemoteObject id="starter" destination="conversationStarter"/><flamingo:SeamRemoteObject id="checker" destination="checker"/><flamingo:SeamRemoteObject id="stopper" destination="conversationStopper"/>
@Name("conversationStarter") Component 1public class ConversationStarter { @Out private ConversationObject conversationObject; @Begin public void start() { conversationObject = new ConversationObject(); }}
@Name("checker") Component 2public class ConversationChecker { @In(required=false) private ConversationObject conversationObject;
public boolean isActive() { return conversationObject != null; }}
Component 3@Name("conversationStopper")public class ConversationStopper { @End() public void stop() {}}
Component 4@Name("conversationObject")@Scope(ScopeType.CONVERSATION)public class ConversationObject {
}
Dynamic Persistent Methods
• Cover high percentage of simple queries• No need to implement DAOs, write SQL, HQL, etc.
• Define remote object:<mx:RemoteObject id="person" destination="Person“ result="resultHandler(event)" …
• Call Dynamic methods:
<mx:Button label="findByNameIsNotNull" click="person.findByNameIsNotNull();"/>
<mx:Button label="findByNameLike" click="person.findByNameLike(parameter.text);"/>
<mx:Button label="findByIdGreaterThan" click="person.findByIdGreaterThan(int(parameter.text));"/>
• Nothing to implement on client or server
Example of New Project Creation
Example of new project creation:Please choose the type of application to generate [flamingo-seam, flamingo-spring]flamingo-seamPlease enter the location in which your new application will be created (i.e. c:/java/development):c:/tmpEnter the project name (e.g. myproject):flamingo-bookPlease enter the root package name for your project (e.g. com.mydomain.myproject):org.javaone.flamingo.bookIs this project deployed as an EAR (with EJB components) or a WAR (with no EJB support)? [ear, war]:earWill this project have Flex and JavaFx user interface? [flex, javafx]:flexWill this project use Hessian or AMF protocol? [amf, hessian]:amfWill this project use Seam Remoting or Flamingo servlets? [servlets, remoting, both]:servletsWhat kind of database are you using? [hsql, mysql, oracle, postgres, mssql, db2, sybase, none]:mysqlEnter the JDBC URL for your database (e.g. jdbc:hsqldb:.):jdbc:mysql:/localhost/testEnter database username:rootEnter database password:******Do you want to update the database schema each time you deploy? [y, n]:yEnter the entity class name (Flex source files to view and modify entities will be generated as well):Book
Generated Project Structure
What you get:
./ear/pom.xml
./ear/src/main/application/META-INF/components.xml
./ear/src/main/application/META-INF/jboss-app.xml
./ejb/pom.xml
./ejb/src/main/java/org/javaone/flamingo/book/domain/Book.java
./ejb/src/main/java/org/javaone/flamingo/book/service/AuthenticatorAction.java
./ejb/src/main/java/org/javaone/flamingo/book/service/BookAction.java
./ejb/src/main/java/org/javaone/flamingo/book/service/BookList.java
./ejb/src/main/java/org/javaone/flamingo/book/service/IBookAction.java
./ejb/src/main/resources/flamingo-book-ds.xml
./ejb/src/main/resources/META-INF/components.xml
./ejb/src/main/resources/META-INF/ejb-jar.xml
./ejb/src/main/resources/META-INF/persistence.xml
./ejb/src/test/java/EntityTest.java
./flex/pom.xml
./flex/src/main/flex/main.mxml
./flex/src/main/flex/org/javaone/flamingo/book/flex/view/BookManager.mxml
./flex/src/main/flex/org/javaone/flamingo/book/flex/vo/Book.as
./flex/src/main/resources/services-config.xml
./pom.xml
./readme.txt
./web/pom.xml
./web/src/main/webapp/index.html
./web/src/main/webapp/WEB-INF/web.xml
Note: Standard Maven commands apply at this point
Developers Feedback
• Flamingo is very young, but we have some positive feedback from the community:
– “I was just reading the Dynamic finders docs, and really: this is a
feature that will save us from a lot of code!”– “IT IS A VERY GOOD JOB, CONGRATULATIONS FOR THE
CREATORS AND CONTRIBUTORS.”– “(I)…generated app structure and it has functioned perfectly! ”
note: caps, spelling and grammar left intact
People Behind Flamingo
• Alex Burak
• Artem Pleskatsevich
• Kirill Lebed
• Igor Polevoy
• Andrei Basharkevich
• Evgeny Zheleznyakov
• The rest of Exadel
Flamingo Roadmap / Vision
• Next Steps– Server push, failover messaging– Relationships– IDE Integration– Migrations?– ASN1– ?
• Vision– Provide much needed Agility for RIA– Soup to nuts environment for building RIA– Comprehensive platform, not just integration layer, everything
needed to develop business applications
Questions?
?