Upgrade to Pro — share decks privately, control downloads, hide ads and more …

Make Enterprise Applications development easy, ...

GWTcon
January 07, 2017

Make Enterprise Applications development easy, fast and reliable: productive-GWT.

GWTcon

January 07, 2017
Tweet

More Decks by GWTcon

Other Decks in Technology

Transcript

  1. Speakers Luca Masini Software Engineer Architect Developer @lmasini - [email protected]

    Alberto Mancini Freelance Software Developer Linux Sysadmin GWT Artisan #Javascript #Java @usernamelibero - [email protected] Thanks to and Rosanna Rinaldi Francesca Tosi
  2. Motivating forces We need A programming model that can lower

    the barrier of using GWT as the GUI framework... ..helped by an archetype for fast startup of new enterprise application project
  3. Target A coherent layout Integration with an external provisioning system

    for user and application data Simplified REST call GWT Widgets that let the developer ignore the underlying HTML5/CSS This was done gluing together some carefully chosen available frameworks.
  4. Why not the sexy XXX framework ? Here a snippet

    of code using ProductiveGWT @MenuEntry(text = "Catalogue") //Integration with GUI... @RestrictedAccess(roles = SecurityRoles.RESPONSABILE) ///...and Security @Page // Navigation integrated with browser history public class CataloguePage extends AbstractRicercaView<Catalogue> { // Declarative and type-safe UI-Binder interface Binder extends UiBinder<VerticalPanel, CataloguePage> { Binder INSTANCE = GWT.create(Binder.class); } @Inject // Service call interface Caller<CatalogueService> catalogueServiceCaller; // My Business code
  5. ReactJS It took 20 years to escape from JSP and

    ASP. Now Facebook has invented JSX, so that we can mix JavaScript and HTML: But Flux is very interesting !!! class App extends React.Component { render() { var i = 1; return ( <div> <h1>{i == 1 ? 'True!' : 'False'}</h1> </div> ); } }
  6. GWT 2.8 Java 8 is cool but.... 2.8 compile time

    is higher than in 2.7 More memory usage (+80%) Variables name now are even more cryptically and still no support from Source Maps
  7. GWT Material Chosen because it's ready to use in production

    now No Google's Material Design Light, we want GWT Widgets and few CSS3/HTML5 (distraction free coding) We are interested observers of gwt-polymer project... ...and the brand new GXT5
  8. Errai Framework Dagger 2 is ligther and can wire applications

    like Errai CDI does, but... ...with Errai CDI we use the same programming model on client code and server code We also used a lot "Errai Navigation", "Errai Security" and "Errai JAX-RS"
  9. General structure of the project Archetype Generation of the project

    Errai Wiring, navigation, security, straightforward JAX Menu generation Java Annotation Processing (APT)
  10. Archetype @MenuEntry(text = "Home, default page", order = 0) @RestrictedAccess(roles

    = {"gwtcon-admin", "gwtcon-user"}) @Page(role = DefaultPage.class, path = "/home") public class Home extends HTML { @Inject BootstrapData bootstapData; @PageShowing private void setup() { } }
  11. ERRAI Framework Errai Navigation easy, annotation based, history, typed inter

    apps (page) transitions; Errai Security clean, annotation based, authorization, SecurityContext; Errai JAX-RS REST-based Web services client-side interceptors Errai IOC @Inject @Alternative, customization
  12. ERRAI Framework Errai Navigation to ... declare page with Page

    Annotation over the classes @Page(role = DefaultPage.class, path = "/home") public class Home extends HTML {...} navigate between pages @Inject TransitionTo<Samples> transition; ... transition.go();
  13. ERRAI Framework Errai Security to ... restrict access through Rescricted

    Access Annotation over: Pages and UI elements @Page(role = DefaultPage.class, path = "/home") @RestrictedAccess(roles = {"gwtcon-admin", "gwtcon-user"}) public class Home extends HTML { @RestrictedAccess(roles = {"gwtcon-admin"}) @Inject @DataField private Button sendLogo; ... } REST resources @GET @Path("/{id}") @Produces(MediaType.APPLICATION_JSON) @RestrictedAccess(roles = "gwtcon-admin") public Customer find(@PathParam("id") long id);
  14. ERRAI Framework IOC to ... obtain user informations and application

    data through DI @Inject BootstrapData bootstrapData; ... Window.alert(bootstrapData.getUserInfo().getUsername()); ... Window.alert(bootstrapData.getApplicationName()); Window.alert(bootstrapData.getServerName());
  15. ERRAI Framework IOC and Alternative to ... customize the SplashPage

    through an instance of AppView @Inject AppView appView; ... appView.getSplashScreen().setText("Splash … "); customize the SplashPage creating an alternative for SplashScreen and activating it into ErraiApp.properties @Alternative public class CustomSplashScreen implements SplashScreen {...} errai.ioc.enabled.alternatives= com.gwtcon.productivegwt.client.ui.CustomSplashScreen
  16. ERRAI Framework Intercerptors to ... handle Async Callback through interceptors

    over REST resources @GET @Path("/{id}") @Produces(MediaType.APPLICATION_JSON) @InterceptedCall(RequestInterceptor.class) public Customer find(@PathParam("id") long id);
  17. Annotation The processor Hook on all classes @AutoService(Processor.class) @SupportedAnnotationTypes(value =

    {"*"}) process, cache and emit @Override public boolean process(Set< ? extends TypeElement> elements, RoundEnvironment env) { if (env.processingOver()) { //last round, we can write //generate the 'menu' with the inforations from the pages-database } else { //.... enlist in the pages-database the current page }