SlideShare a Scribd company logo
1 of 17
1
A CROSS-DEVICE WEB FOCUSED
FRAMEWORK
THIAGO R. BUSTAMANTE
www.cruxframework.org
First… Who am I?
2
Thiago da Rosa de Bustamante
Java Architect & Crux founder.
thiago.bustamante@triggolabs.com
Master's Degree in Computer Science, UFMG – BR
BS in Computer Science, UFV - BR
3
Front-end
Framework
Secure and
Reliable
100%
Open Source
Mantained by:
What is Crux?
4
Cross-device
applications
Simplified
development
Powerful API
on the client’s side
Why Crux?
Adaptive Components
5
Single Contract (Write only one code)
Different screen sizes (Small or Large)
Different interaction
model (Touch,
Mouse, Arrows)
Development Model
6
(MVC)
Lots of other features
7
Dependency Injection on Client
Local
Database
REST
Offline
Support
Value Binding
Animations
(CSS3 / JS)
HTML5 APIs
Support
Open Social Support
Bootstrap 2.0 / 3.0
Integration
Apache Cordova
Integration
Demo!
9
VIEW screen: main.view.xml
<v:view
xmlns="http://www.w3.org/1999/xhtml"
xmlns:v="http://www.cruxframework.org/view"
xmlns:faces="http://www.cruxframework.org/crux/smart-faces"
title="${messages.myContacts}"
useController="contactsController">
<faces:label id="title" text="${messages.myContacts}"/>
<faces:widgetList id="contacts" pageSize="25" >
<faces:lazyDataProvider onFetchData="contactsController.onFetchContacts"
onMeasureData="contactsController.onCountContacts"
dataObject="contact" autoLoadData="true"/>
<faces:widget>
<faces:label id="contactLabel" text="@{contact.lastName}, @{contact.firstName}"
onSelect="contactsController.onSelectContact"/>
</faces:widget>
</faces:widgetList>
<faces:navPanel id="controlPanel">
<faces:button id="edit" text="${messages.editContact}"
onSelect="contactsController.editContact"/>
<faces:button id="remove" text="${messages.removeContact}"
onSelect="contactsController.removeContact"/>
....
</faces:navPanel>
</v:view>
10
<v:view
xmlns="http://www.w3.org/1999/xhtml"
xmlns:v="http://www.cruxframework.org/view"
xmlns:crux="http://www.cruxframework.org/crux/widgets"
xmlns:gwt="http://www.cruxframework.org/crux/gwt"
xmlns:faces="http://www.cruxframework.org/crux/smart-faces"
useController="contactInfoController"
onLoad="contactInfoController.onLoad"
title="${messages.contactInfo}">
<crux:formDisplay id="contactForm">
<crux:entry label="${messages.firstName}" horizontalAlignment="right">
<gwt:textBox id="txtFirstName" value="@{contact.firstName}" />
</crux:entry>
<crux:entry label="${messages.lastName}" horizontalAlignment="right">
<gwt:textBox id="txtLastName" value="@{contact.lastName}" />
</crux:entry>
<crux:entry label="${messages.email}" horizontalAlignment="right">
<gwt:textBox id="txtEmail" value="@{contact.email}" />
</crux:entry>
<crux:entry>
<faces:navPanel id="btnPanel" style="text-align:center;">
<faces:button id="btnSave" text="${messages.save}"
onSelect="contactInfoController.saveAddOrUpdate" />
<faces:button id="btnCancel" text="${messages.cancel}"
onSelect="contactInfoController.cancel"
/>
</faces:navPanel>
</crux:entry>
</crux:formDisplay>
VIEW screen: contact.view.xml
11
@Controller("contactInfoController")
public class ContactInfoController
{
@Inject
public MainViewControllers mainControllers;
private boolean newRecord;
@Expose
public void onLoad(ViewLoadEvent event)
{
Contact contact = event.getParameterObject();
newRecord = contact == null;
if (!newRecord)
{
View.of(this).write(contact);
}
}
private Contact getContact()
{
return View.of(this).read(Contact.class);
}
//...
CONTROLLER class: ContactInfoController.java
12
@DataObject("contact")
public class Contact implements Serializable
{
private static final long serialVersionUID = -848444894214013789L;
private String firstName;
private String lastName;
private String email;
public Contact()
{
}
public Contact(String firstName, String lastName, String email)
{
this.firstName = firstName;
this.lastName = lastName;
this.email = email;
}
// getters and setters...
MODEL class: Contact.java
13
@RestService("contactService")
@Path("contact")
public class ContactService
{
@GET(cacheTime=GET.ONE_DAY)
@Path("size")
public Integer countContacts()
{
int result = 0;
// read the contact list size from database
return result;
}
@GET
@Path("all")
public Contact[] getContacts(@QueryParam("start")int startRecord,
@QueryParam("size")int pageSize)
{
Contact[] result = null;
// read the contact list from database
return result;
}
MODEL class: ContactService.java
14
@TargetRestService("contactService")
public interface ContactRestProxy extends RestProxy
{
void countContacts(Callback<Integer> callback);
void getContacts(int startRecord, int pageSize, Callback<List<Contact>> callback);
}
MODEL class: ContactRestProxy.java
15
@Controller("contactsController")
public class ContactsController
{
@Inject
public ContactRestProxy contractService;
@Expose
public void onCountContacts(final MeasureDataEvent<Contact> event)
{
contractService.countContacts(new Callback<Integer>()
{
@Override
public void onSuccess(Integer result)
{
event.getSource().setSize(result);
}
@Override
public void onError(Exception e)
{
MessageBox.show(e.getMessage(), MessageType.ERROR);
}
});
}
//...
CONTROLLER class: ContactController.java
Questions?
16
thiago.bustamante@triggolabs.com
www.cruxframework.org
Thiago Bustamante
Thanks.
17
Get in touch
thiago.bustamante@triggolabs.com
www.cruxframework.org
Thiago Bustamante

More Related Content

Viewers also liked

Faiz Aldalbhi CV English dated 17 Nov 15
Faiz Aldalbhi CV English dated 17 Nov 15Faiz Aldalbhi CV English dated 17 Nov 15
Faiz Aldalbhi CV English dated 17 Nov 15
Faiz Aldalbhi
 
Faiz Aldalbhi CV English dated 17 Nov 15
Faiz Aldalbhi CV English dated 17 Nov 15Faiz Aldalbhi CV English dated 17 Nov 15
Faiz Aldalbhi CV English dated 17 Nov 15
Faiz Aldalbhi
 

Viewers also liked (16)

Faiz Aldalbhi CV English dated 17 Nov 15
Faiz Aldalbhi CV English dated 17 Nov 15Faiz Aldalbhi CV English dated 17 Nov 15
Faiz Aldalbhi CV English dated 17 Nov 15
 
Faiz Aldalbhi CV English dated 17 Nov 15
Faiz Aldalbhi CV English dated 17 Nov 15Faiz Aldalbhi CV English dated 17 Nov 15
Faiz Aldalbhi CV English dated 17 Nov 15
 
TEMBA. E, RESUME
TEMBA. E, RESUMETEMBA. E, RESUME
TEMBA. E, RESUME
 
Letting others lead
Letting others leadLetting others lead
Letting others lead
 
Norme de-aplicare a Legii 142/1998 privind tichetele de masa
Norme de-aplicare a Legii 142/1998 privind tichetele de masaNorme de-aplicare a Legii 142/1998 privind tichetele de masa
Norme de-aplicare a Legii 142/1998 privind tichetele de masa
 
Mom's Back To School Essentials
Mom's Back To School EssentialsMom's Back To School Essentials
Mom's Back To School Essentials
 
Non verbal communication
Non verbal communicationNon verbal communication
Non verbal communication
 
Archive Recovery Software
Archive Recovery SoftwareArchive Recovery Software
Archive Recovery Software
 
BHAKTI
BHAKTIBHAKTI
BHAKTI
 
Sales pitch
Sales pitchSales pitch
Sales pitch
 
Sales pitch
Sales pitchSales pitch
Sales pitch
 
Bab v
Bab vBab v
Bab v
 
Proceso de paz (1)
Proceso de paz (1)Proceso de paz (1)
Proceso de paz (1)
 
Are You Too Busy?
Are You Too Busy?Are You Too Busy?
Are You Too Busy?
 
Teekait may 16
Teekait may 16Teekait may 16
Teekait may 16
 
Mathematica. 3[1]
Mathematica. 3[1]Mathematica. 3[1]
Mathematica. 3[1]
 

Similar to Gwt.create - Presentation

Madhusudhakar_3.2_DotNet_BluestarInfotech
Madhusudhakar_3.2_DotNet_BluestarInfotechMadhusudhakar_3.2_DotNet_BluestarInfotech
Madhusudhakar_3.2_DotNet_BluestarInfotech
Madhusudhakar Mogathali
 
W3 conf hill-html5-security-realities
W3 conf hill-html5-security-realitiesW3 conf hill-html5-security-realities
W3 conf hill-html5-security-realities
Brad Hill
 
Directions on microsoft_web_and_cloud_development
Directions on microsoft_web_and_cloud_developmentDirections on microsoft_web_and_cloud_development
Directions on microsoft_web_and_cloud_development
Takeshi Shinmura
 
Openshift visual workflows
Openshift visual workflowsOpenshift visual workflows
Openshift visual workflows
IIIT HYDERABAD
 

Similar to Gwt.create - Presentation (20)

Madhusudhakar_3.2_DotNet_BluestarInfotech
Madhusudhakar_3.2_DotNet_BluestarInfotechMadhusudhakar_3.2_DotNet_BluestarInfotech
Madhusudhakar_3.2_DotNet_BluestarInfotech
 
Security Architecture Consulting - Hiren Shah
Security Architecture Consulting - Hiren ShahSecurity Architecture Consulting - Hiren Shah
Security Architecture Consulting - Hiren Shah
 
W3 conf hill-html5-security-realities
W3 conf hill-html5-security-realitiesW3 conf hill-html5-security-realities
W3 conf hill-html5-security-realities
 
Top 10 HTML5 frameworks for effective development in 2016
Top 10 HTML5 frameworks for effective development in 2016Top 10 HTML5 frameworks for effective development in 2016
Top 10 HTML5 frameworks for effective development in 2016
 
Live Mesh Presentation Bruno Svc
Live Mesh Presentation Bruno SvcLive Mesh Presentation Bruno Svc
Live Mesh Presentation Bruno Svc
 
Charan Grandhi_Resume
Charan Grandhi_ResumeCharan Grandhi_Resume
Charan Grandhi_Resume
 
Cross Platform Mobile Technologies
Cross Platform Mobile TechnologiesCross Platform Mobile Technologies
Cross Platform Mobile Technologies
 
Geethu Rajasekharan
Geethu RajasekharanGeethu Rajasekharan
Geethu Rajasekharan
 
cv-2016-23
cv-2016-23cv-2016-23
cv-2016-23
 
Sindhura Vallabhaneni
Sindhura VallabhaneniSindhura Vallabhaneni
Sindhura Vallabhaneni
 
Web application framework
Web application frameworkWeb application framework
Web application framework
 
eswar.pptx
eswar.pptxeswar.pptx
eswar.pptx
 
Directions on microsoft_web_and_cloud_development
Directions on microsoft_web_and_cloud_developmentDirections on microsoft_web_and_cloud_development
Directions on microsoft_web_and_cloud_development
 
Bruce lawson-over-the-air
Bruce lawson-over-the-airBruce lawson-over-the-air
Bruce lawson-over-the-air
 
2009 - Microsoft Springbreak: IIS, PHP & WCF
2009 - Microsoft Springbreak: IIS, PHP & WCF2009 - Microsoft Springbreak: IIS, PHP & WCF
2009 - Microsoft Springbreak: IIS, PHP & WCF
 
Tecnologias Free e Open Source na Plataforma Microsoft
Tecnologias Free e Open Source na Plataforma MicrosoftTecnologias Free e Open Source na Plataforma Microsoft
Tecnologias Free e Open Source na Plataforma Microsoft
 
Abhishek_Anand_Resume
Abhishek_Anand_ResumeAbhishek_Anand_Resume
Abhishek_Anand_Resume
 
Openshift visual workflows
Openshift visual workflowsOpenshift visual workflows
Openshift visual workflows
 
StrongLoop Overview
StrongLoop OverviewStrongLoop Overview
StrongLoop Overview
 
Silverlight
SilverlightSilverlight
Silverlight
 

Recently uploaded

Large-scale Logging Made Easy: Meetup at Deutsche Bank 2024
Large-scale Logging Made Easy: Meetup at Deutsche Bank 2024Large-scale Logging Made Easy: Meetup at Deutsche Bank 2024
Large-scale Logging Made Easy: Meetup at Deutsche Bank 2024
VictoriaMetrics
 
Abortion Pill Prices Tembisa [(+27832195400*)] 🏥 Women's Abortion Clinic in T...
Abortion Pill Prices Tembisa [(+27832195400*)] 🏥 Women's Abortion Clinic in T...Abortion Pill Prices Tembisa [(+27832195400*)] 🏥 Women's Abortion Clinic in T...
Abortion Pill Prices Tembisa [(+27832195400*)] 🏥 Women's Abortion Clinic in T...
Medical / Health Care (+971588192166) Mifepristone and Misoprostol tablets 200mg
 
%+27788225528 love spells in Boston Psychic Readings, Attraction spells,Bring...
%+27788225528 love spells in Boston Psychic Readings, Attraction spells,Bring...%+27788225528 love spells in Boston Psychic Readings, Attraction spells,Bring...
%+27788225528 love spells in Boston Psychic Readings, Attraction spells,Bring...
masabamasaba
 
+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...
+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...
+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...
Health
 
%+27788225528 love spells in Toronto Psychic Readings, Attraction spells,Brin...
%+27788225528 love spells in Toronto Psychic Readings, Attraction spells,Brin...%+27788225528 love spells in Toronto Psychic Readings, Attraction spells,Brin...
%+27788225528 love spells in Toronto Psychic Readings, Attraction spells,Brin...
masabamasaba
 

Recently uploaded (20)

Direct Style Effect Systems - The Print[A] Example - A Comprehension Aid
Direct Style Effect Systems -The Print[A] Example- A Comprehension AidDirect Style Effect Systems -The Print[A] Example- A Comprehension Aid
Direct Style Effect Systems - The Print[A] Example - A Comprehension Aid
 
Large-scale Logging Made Easy: Meetup at Deutsche Bank 2024
Large-scale Logging Made Easy: Meetup at Deutsche Bank 2024Large-scale Logging Made Easy: Meetup at Deutsche Bank 2024
Large-scale Logging Made Easy: Meetup at Deutsche Bank 2024
 
Announcing Codolex 2.0 from GDK Software
Announcing Codolex 2.0 from GDK SoftwareAnnouncing Codolex 2.0 from GDK Software
Announcing Codolex 2.0 from GDK Software
 
Abortion Pill Prices Tembisa [(+27832195400*)] 🏥 Women's Abortion Clinic in T...
Abortion Pill Prices Tembisa [(+27832195400*)] 🏥 Women's Abortion Clinic in T...Abortion Pill Prices Tembisa [(+27832195400*)] 🏥 Women's Abortion Clinic in T...
Abortion Pill Prices Tembisa [(+27832195400*)] 🏥 Women's Abortion Clinic in T...
 
%+27788225528 love spells in Boston Psychic Readings, Attraction spells,Bring...
%+27788225528 love spells in Boston Psychic Readings, Attraction spells,Bring...%+27788225528 love spells in Boston Psychic Readings, Attraction spells,Bring...
%+27788225528 love spells in Boston Psychic Readings, Attraction spells,Bring...
 
%in Midrand+277-882-255-28 abortion pills for sale in midrand
%in Midrand+277-882-255-28 abortion pills for sale in midrand%in Midrand+277-882-255-28 abortion pills for sale in midrand
%in Midrand+277-882-255-28 abortion pills for sale in midrand
 
+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...
+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...
+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...
 
WSO2CON 2024 - Does Open Source Still Matter?
WSO2CON 2024 - Does Open Source Still Matter?WSO2CON 2024 - Does Open Source Still Matter?
WSO2CON 2024 - Does Open Source Still Matter?
 
WSO2CON 2024 - Cloud Native Middleware: Domain-Driven Design, Cell-Based Arch...
WSO2CON 2024 - Cloud Native Middleware: Domain-Driven Design, Cell-Based Arch...WSO2CON 2024 - Cloud Native Middleware: Domain-Driven Design, Cell-Based Arch...
WSO2CON 2024 - Cloud Native Middleware: Domain-Driven Design, Cell-Based Arch...
 
%in kempton park+277-882-255-28 abortion pills for sale in kempton park
%in kempton park+277-882-255-28 abortion pills for sale in kempton park %in kempton park+277-882-255-28 abortion pills for sale in kempton park
%in kempton park+277-882-255-28 abortion pills for sale in kempton park
 
%in Bahrain+277-882-255-28 abortion pills for sale in Bahrain
%in Bahrain+277-882-255-28 abortion pills for sale in Bahrain%in Bahrain+277-882-255-28 abortion pills for sale in Bahrain
%in Bahrain+277-882-255-28 abortion pills for sale in Bahrain
 
%in Benoni+277-882-255-28 abortion pills for sale in Benoni
%in Benoni+277-882-255-28 abortion pills for sale in Benoni%in Benoni+277-882-255-28 abortion pills for sale in Benoni
%in Benoni+277-882-255-28 abortion pills for sale in Benoni
 
Architecture decision records - How not to get lost in the past
Architecture decision records - How not to get lost in the pastArchitecture decision records - How not to get lost in the past
Architecture decision records - How not to get lost in the past
 
%in tembisa+277-882-255-28 abortion pills for sale in tembisa
%in tembisa+277-882-255-28 abortion pills for sale in tembisa%in tembisa+277-882-255-28 abortion pills for sale in tembisa
%in tembisa+277-882-255-28 abortion pills for sale in tembisa
 
%+27788225528 love spells in Toronto Psychic Readings, Attraction spells,Brin...
%+27788225528 love spells in Toronto Psychic Readings, Attraction spells,Brin...%+27788225528 love spells in Toronto Psychic Readings, Attraction spells,Brin...
%+27788225528 love spells in Toronto Psychic Readings, Attraction spells,Brin...
 
Crypto Cloud Review - How To Earn Up To $500 Per DAY Of Bitcoin 100% On AutoP...
Crypto Cloud Review - How To Earn Up To $500 Per DAY Of Bitcoin 100% On AutoP...Crypto Cloud Review - How To Earn Up To $500 Per DAY Of Bitcoin 100% On AutoP...
Crypto Cloud Review - How To Earn Up To $500 Per DAY Of Bitcoin 100% On AutoP...
 
VTU technical seminar 8Th Sem on Scikit-learn
VTU technical seminar 8Th Sem on Scikit-learnVTU technical seminar 8Th Sem on Scikit-learn
VTU technical seminar 8Th Sem on Scikit-learn
 
%in Soweto+277-882-255-28 abortion pills for sale in soweto
%in Soweto+277-882-255-28 abortion pills for sale in soweto%in Soweto+277-882-255-28 abortion pills for sale in soweto
%in Soweto+277-882-255-28 abortion pills for sale in soweto
 
WSO2CON2024 - It's time to go Platformless
WSO2CON2024 - It's time to go PlatformlessWSO2CON2024 - It's time to go Platformless
WSO2CON2024 - It's time to go Platformless
 
OpenChain - The Ramifications of ISO/IEC 5230 and ISO/IEC 18974 for Legal Pro...
OpenChain - The Ramifications of ISO/IEC 5230 and ISO/IEC 18974 for Legal Pro...OpenChain - The Ramifications of ISO/IEC 5230 and ISO/IEC 18974 for Legal Pro...
OpenChain - The Ramifications of ISO/IEC 5230 and ISO/IEC 18974 for Legal Pro...
 

Gwt.create - Presentation

Editor's Notes

  1. My name I am Brazilian Thanks organization Start with overview and show a demo
  2. Open Source, over GWT, develop Cross device apps Created to meet domestic needs We would like now to show it to GWT community. Can be helpful to others and help us to improve our tool Crux proven to be an excellent tool for large enterprise apps development. Example. Today, the main software, responsible for all custumer service, of largest telephone company in Brazil . 1.5 milion lines of code. 2 thousand screens
  3. A lot of reasons to use crux 1) prepared to assist the creation of applications that can adapt to different types of devices, such as smartphones, tablets, desktops or televisions 2) Provides a very simple and fast development model, making the creation and maintenance of software a more productive task 3) Provides a powerfull and extensive API to support the coding of the client layer
  4. To adapt to the type of device, does not means that we must ONLY to be responsive Responsve design is NOT ENOUGH. It is necessary to handle the differences in the interaction model of each kind of device The user experience using a mouse is different from experience using fingers or a remote control Crux provides Adaptive widgets. They can present themselves differently for each type of device Considering SCREEN SIZE and the TYPE OF INPUT supported by the device A compilation property maps the types of devices that we can handle. Different permutations are generated for each type of device
  5. Simple development model based on MVC design pattern. View layer consists of SCREENS. Each one created declaratively in a separated XHTML file. Each screen may be associated with one or more CONTROLLER classes. POJOs containing handlers for events fired on the screen. Crux is a PAGE ORIENTED framework, while still creates SINGLE PAGE APPLICATION. We have LOGICAL pages, which, PHYSICALLY, are loaded into the SAME DOCUMENT when they become necessary, bringing with them all the associated controllers. The model layer is composed by business classes located on the client side or on the server side, and can make use of our powerfull APIs
  6. Provides several APIs to assist the development, such as DEPENDENCY INJECTION on client side, Local DATABASE support REST communication Automatic VALUE BINDING between view files and controllers (SIMILAR TO THAT PROVIDED BY ANGULARJS)
  7. Now I want to show you a simple demonstration of crux usage. Simple application that shows a contact list here and allow us to add / remove / edit contacts into this list. The application has only 2 SCREENS and some operations on the server side that provides these data to the client.
  8. We can see HOW THE VIEW LAYER of the app was coded. We have TWO SEPARATED XML files, one for each screen. This is the FIRST ONE, that represents the main screen, containing the contact list. See how I18N messages can be REFERED inside VIEW files. Se how the CONTROLLER’S METHODS can be associated with widgets events See how VALUE BINDING is EASY with crux
  9. This file represents the second view of the app (Dialog). We have another example of Crux VALUE BINDING feature
  10. This is the controller used by the Dialog Screen. We have an EVENT HANDLER for the view loading event. See how to access, from the CONTROLLER layer, the dataObjects declared on the VIEW layer. Here I am transferring information from the Contact dataObject to the widgets on the Screen Then I am reading this dataObject from the screen
  11. See a simple mapping for a dataObject Simple POJO, that just need to use the DataObject ANNOTATION
  12. Example of how to create a REST service using Crux, at the server side. We are defining two operations here, One to return the number of contacts and other to retrieve a list of contacts Note that we have the RestService Annotation on this class that gives to it an alias .
  13. See how to define a proxy to automatically call the operations that we defined on our contactsService. Note that we point to the service that will be called through TargetRestService annotation. We just need to inform there the alias of the service we want to call.
  14. We can call the service operations through our proxy in a very similar way to GWT RPC feature With a better Performance, because of the cache policy we can use now. It is possible to see a simple example of our DEPENDENCY INJECTION feature here