Tuesday, August 20, 2013

Re: Need Editor Framework help

Alfredo, thank you. That helps simplify things a lot. I have only used UiBinder a little bit and I haven't done anything with RequestFactory. So those examples combined with Editor Framework have really complicated things and make it hard to learn just the Editor Framework part. Your EditorViewImpl example is exactly what I was looking for.

Thomas, thank you for the detailed response!
I will likely need some level of validation on both the client and server. Hopefully there is time in the project to do this properly.

Yes, we are using GWT Designer but seeing that it is not being actively supported by Google and is still not open for contributions, I'm not sure how much longer that will be the case. It is quite helpful and powerful when it works and after it finally loads.

I understand that the Editor Framework doesn't deal with events, but it is great to see you explain that it will still fit within an MVP architecture. We are using an EventBus with EventBinder.

I hadn't seen that blog post, it does seem to have a little bit of detail that isn't on http://www.gwtproject.org/doc/latest/DevGuideUiEditors.html

I'll take another crack at it today and hopefully be able to figure out whether EF will work for us or not. Maybe we'll end up using it in certain places but not in others. We'll see...


On Tuesday, August 20, 2013 6:03:29 AM UTC-4, Thomas Broyer wrote:


On Tuesday, August 20, 2013 12:44:22 AM UTC+2, Michael Prentice wrote:
I spent most of Friday reading up on Editor Framework and it seemed quite powerful and useful. But today I'm looking at actually making use of it and I've had some fairly basic questions which I have not been able to find answers to in this group or anywhere on Google/gwtproject.org.

1) Does the use of Editor Framework require the use of UiBinder?

No.
 
i.e. can I use it with a regular Java view? 

You don't even need "widgets" actually; see https://gwt.googlesource.com/gwt/+/2.5.1/user/test/com/google/gwt/editor/client/ for examples.
 
2) Does the use of Editor Framework require the use of RequestFactory?

No, that's why there are 2 distinct EditorDrivers: SimpleBeanEditorDriver and RequestFactoryEditorDriver.
 
This answer appears to be no, but I haven't been able to find any examples that don't use RequestFactory. Do such examples exist?

 
3) What options exist in GWT for doing databinding? It looks like UiBinder itself takes care of doing data binding. So I guess that Editor Framework is not so much about data binding, instead it adds validation, Editor composition, and?

UiBinder is not at all about data binding. It only generates the Java code that you would have written by hand to build and arrange your widgets and listen to their events. The "binding" in UiBinder is only about associating objects with your @UiField-annotated fields and bind events to your @UiHandler-annotated methods.

The Editor framework on the other hand is all about data binding. It can propagate constraint violations to HasEditorErrors editors, and HasEditorDelegate editors can generate errors, but the framework itself does not deal with validation (you can use JSR303 bean validation in GWT, or defer to your server; for example, in one of our apps, the server validates objects asynchronously when they're saved, and the client fetches the constraint violations for display – errors are not blocking, mostly metadata).

I still can't really figure out if the Editor Framework is right for my project or not. I use DTOs via GWT-RPC without any RequestFactory.

That's OK.
 
My current views are Java (no UiBinder)

How painful it should be working on these things… (or are you using the GWT Designer?)
 
but I might switch to UiBinder. I've got the architecture for MVP laid out pretty well and I'm having a hard time figuring out how Editors fit into the mix.

The way I do it is to have the view create and initialize the EditorDriver; the presenter gets it from the view and edits/flushes the data.

The views thus generally define a method such as "SimpleBeanEditorDriver<MyBean, ?> createDriver()". That way, only the view needs to know about the Editor being used (which is generally a Widget).

The DTOs whose data is exposed in my views does not map directly to what is displayed in the view one-to-one. Many views display data taken from multiple DTOs. Also actions/selections in one view must result in changes to other views on the page. This means that selecting an item in one view could cause (via Events) multiple presenters to disable/enable elements in their views.

The Editor framework is built around the Flow Synchronization pattern: it doesn't deal with events at all (neither from the "model" to update the "view", nor from the "view" to update the "model").
So all these events will have to be dealt with outside the Editor framework (e.g. with UiBinder's @UiHandler, and possibly through an EventBus)
 
Are there are good IO videos that cover Editor Framework in detail?

I can't remember of one. Maybe the "overhaul" video from when GWT 2.1 was presented? (simultaneously with the first milestone of GWT 2.1, where RequestFactory, the Editor framework, etc. were introduced)
But it wouldn't be "in detail".

I've read the details on gwtproject.org, code.google.com, and various blogs plus the DynaTableRf example.

Did you read http://blog.ltgt.net/gwt-21-editors/ ? (shameless self-promotion)
 
But while trying to implement this stuff today, it just feels wrong, like it isn't going to fit/work/etc with what I'm doing. So I'm trying to figure out if I should just not use Editor Framework at all.

The "many views display data taken from multiple DTOs" makes me think the Editor framework might not be a good fit for your project, but it's hard to tell.

--
You received this message because you are subscribed to the Google Groups "Google Web Toolkit" group.
To unsubscribe from this group and stop receiving emails from it, send an email to google-web-toolkit+unsubscribe@googlegroups.com.
To post to this group, send email to google-web-toolkit@googlegroups.com.
Visit this group at http://groups.google.com/group/google-web-toolkit.
For more options, visit https://groups.google.com/groups/opt_out.

No comments:

Post a Comment