Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Errai experience: user interface, communication, dependency injection

I have a broad experience with GWT, GIN and GWTP-dispatch and since I don't have any experience with Errai I'd like to ask you if it's really a good choice to build entire single page rich web application on Errai as a foundation. If you have broad experience with Errai, it'd be great to hear from you.

I'm building a video streaming web app. Let's say it's another YouTube (layout, actions, flow, etc.) but on steroids (which are not relevant).

I've read entire docs of Errai and here are my concerns/questions.

  1. Errai JAX-RS - I'm not interested in any sophisticated messaging Errai is really famous for i.e. server->client, client->client, broadcasting, conversations, etc. I want simple AJAX calls through RS. Obvious concern is performance of communication, no redundant calls, just single HTTP request and response?
    What about the limitations mentioned here (How do you integrate GWT with a JAX-RS/RESTEasy server using Errai?): are these things up to date and I would have to implement REST services with some Errai limitations in mind?

  2. Errai IoC/CDI - GIN seems more mature to me, definitely more popular (with all benefits of that). But it looks like they can coexist perfectly or I should rather pick one of them? It's nice to have many Errai beans (like Caller) injected with a single annotation. For how I understand it I don't need CDI. If I use Errai IOC in my project what additional functionality do I gain with CDI? Do I have to have it on my classpath so that everything is instantiated by ioc container?
    Do I understand it correctly: IoC enables simple wiring and CDI is where I can actually configure and instantiate beans that would be injected? For instance @Produces is in CDI, not in IOC. Could you explain what is the difference between Errai IOC and CDI in the context of pure DI? I know that one is superset of another but I still don't quite get it.

  3. Errai data binding: great, great feature BUT it distorts MVP pattern. Currenlty I have written my app in basic MVP (no mvp framework and no interaction between Model and View). Can I manage data bindings on @Model from presenter and not from view (which would utilize HTML templates with Errai UI)?

  4. Errai UI: What about existing widgets of GWT like CellTable in the context of data binding and wiring View class with a template?
    In general what approach do you use when writing more sophisticated widgets (like an image gallery with pager for instance) with Errai? Do you utilize existing GWT widget (like CellTable) - single heavy widget - or rather layout everything within html template and just wire certain divs to corresponding data fields in View class - more lightweight widgets? I've come across this opinion of one of the authors of Errai UI:
    The nice thing about Errai UI is you just dump this template file into your project and you say “OK this piece of the template belongs to this component” or “this piece of the template belongs to this other component”. And you can wire these things together and your template just comes to life in front of you – right in the browser.
    So let's say I have an html layout of entire image gallery. Obviously I wouldn't like to re-create that with CellTable but utilize that layout so I would have to be able to: create entire image gallery as a Composite which itself would have to wire to outer-most element in layout and wire every data-field to corresponding property in my Composite class. Is that possible?

Server should be GWT/Errai agnostic: On the server side I'd like to use Errai as minimum as possible (because I don't want any fancy communication features like I said) and maintain app with Spring on Jetty or Tomcat.

With adding a new technology as a foundation, i.e. building entire app on it, there is always a risk that it will be not be flexible enough meaning that some hacks will be necessary to overcome unforeseen obstacles or in some terrible circumstances entire technology will have to be abandoned.

Last simple question: where is errai's online javadoc?

like image 471
piotrb86 Avatar asked Jun 15 '14 10:06

piotrb86


1 Answers

Short answer, building using GWT is greatly simplified, structured with Errai.

The HTML-based templating allows you to build web apps using standard web technologies and not to deal with UiBinder or domain specific language, the Page-drive approach allows you to deal with your application domain problem, page by page which is more natural for any web application, after all, we browse the web page by page.

There are many more things you will like with JBoss Errai framework.

I hope this answers your long buried question.

like image 140
quarks Avatar answered Nov 10 '22 20:11

quarks