SlideShare uma empresa Scribd logo
1 de 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

Mais conteúdo relacionado

Destaque

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
 

Destaque (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]
 

Semelhante a 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
 

Semelhante a 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
 

Último

+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
 
The title is not connected to what is inside
The title is not connected to what is insideThe title is not connected to what is inside
The title is not connected to what is inside
shinachiaurasa2
 
introduction-to-automotive Andoid os-csimmonds-ndctechtown-2021.pdf
introduction-to-automotive Andoid os-csimmonds-ndctechtown-2021.pdfintroduction-to-automotive Andoid os-csimmonds-ndctechtown-2021.pdf
introduction-to-automotive Andoid os-csimmonds-ndctechtown-2021.pdf
VishalKumarJha10
 
AI Mastery 201: Elevating Your Workflow with Advanced LLM Techniques
AI Mastery 201: Elevating Your Workflow with Advanced LLM TechniquesAI Mastery 201: Elevating Your Workflow with Advanced LLM Techniques
AI Mastery 201: Elevating Your Workflow with Advanced LLM Techniques
VictorSzoltysek
 
TECUNIQUE: Success Stories: IT Service provider
TECUNIQUE: Success Stories: IT Service providerTECUNIQUE: Success Stories: IT Service provider
TECUNIQUE: Success Stories: IT Service provider
mohitmore19
 

Último (20)

10 Trends Likely to Shape Enterprise Technology in 2024
10 Trends Likely to Shape Enterprise Technology in 202410 Trends Likely to Shape Enterprise Technology in 2024
10 Trends Likely to Shape Enterprise Technology in 2024
 
%in ivory park+277-882-255-28 abortion pills for sale in ivory park
%in ivory park+277-882-255-28 abortion pills for sale in ivory park %in ivory park+277-882-255-28 abortion pills for sale in ivory park
%in ivory park+277-882-255-28 abortion pills for sale in ivory park
 
Optimizing AI for immediate response in Smart CCTV
Optimizing AI for immediate response in Smart CCTVOptimizing AI for immediate response in Smart CCTV
Optimizing AI for immediate response in Smart CCTV
 
+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...
 
The Top App Development Trends Shaping the Industry in 2024-25 .pdf
The Top App Development Trends Shaping the Industry in 2024-25 .pdfThe Top App Development Trends Shaping the Industry in 2024-25 .pdf
The Top App Development Trends Shaping the Industry in 2024-25 .pdf
 
A Secure and Reliable Document Management System is Essential.docx
A Secure and Reliable Document Management System is Essential.docxA Secure and Reliable Document Management System is Essential.docx
A Secure and Reliable Document Management System is Essential.docx
 
The title is not connected to what is inside
The title is not connected to what is insideThe title is not connected to what is inside
The title is not connected to what is inside
 
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...
 
The Ultimate Test Automation Guide_ Best Practices and Tips.pdf
The Ultimate Test Automation Guide_ Best Practices and Tips.pdfThe Ultimate Test Automation Guide_ Best Practices and Tips.pdf
The Ultimate Test Automation Guide_ Best Practices and Tips.pdf
 
%in kaalfontein+277-882-255-28 abortion pills for sale in kaalfontein
%in kaalfontein+277-882-255-28 abortion pills for sale in kaalfontein%in kaalfontein+277-882-255-28 abortion pills for sale in kaalfontein
%in kaalfontein+277-882-255-28 abortion pills for sale in kaalfontein
 
introduction-to-automotive Andoid os-csimmonds-ndctechtown-2021.pdf
introduction-to-automotive Andoid os-csimmonds-ndctechtown-2021.pdfintroduction-to-automotive Andoid os-csimmonds-ndctechtown-2021.pdf
introduction-to-automotive Andoid os-csimmonds-ndctechtown-2021.pdf
 
Exploring the Best Video Editing App.pdf
Exploring the Best Video Editing App.pdfExploring the Best Video Editing App.pdf
Exploring the Best Video Editing App.pdf
 
%in Stilfontein+277-882-255-28 abortion pills for sale in Stilfontein
%in Stilfontein+277-882-255-28 abortion pills for sale in Stilfontein%in Stilfontein+277-882-255-28 abortion pills for sale in Stilfontein
%in Stilfontein+277-882-255-28 abortion pills for sale in Stilfontein
 
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...
 
Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...
Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...
Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...
 
How To Troubleshoot Collaboration Apps for the Modern Connected Worker
How To Troubleshoot Collaboration Apps for the Modern Connected WorkerHow To Troubleshoot Collaboration Apps for the Modern Connected Worker
How To Troubleshoot Collaboration Apps for the Modern Connected Worker
 
AI Mastery 201: Elevating Your Workflow with Advanced LLM Techniques
AI Mastery 201: Elevating Your Workflow with Advanced LLM TechniquesAI Mastery 201: Elevating Your Workflow with Advanced LLM Techniques
AI Mastery 201: Elevating Your Workflow with Advanced LLM Techniques
 
TECUNIQUE: Success Stories: IT Service provider
TECUNIQUE: Success Stories: IT Service providerTECUNIQUE: Success Stories: IT Service provider
TECUNIQUE: Success Stories: IT Service provider
 
Chinsurah Escorts ☎️8617697112 Starting From 5K to 15K High Profile Escorts ...
Chinsurah Escorts ☎️8617697112  Starting From 5K to 15K High Profile Escorts ...Chinsurah Escorts ☎️8617697112  Starting From 5K to 15K High Profile Escorts ...
Chinsurah Escorts ☎️8617697112 Starting From 5K to 15K High Profile Escorts ...
 
Learn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdf
Learn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdfLearn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdf
Learn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdf
 

Gwt.create - Presentation

Notas do Editor

  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