Newbie getting started question

20 views
Skip to first unread message

Mike Warne

unread,
Apr 4, 2016, 3:28:04 PM4/4/16
to Mvp4g
Hi, 

I have the employeeadmin example up and running.
I am now going to start a simple project, hoping to get up to speed.

I noticed that the GWT.xml file for the example has a number of replace-with sections for the views.
It seems to be  quite a bit of configuration to add a view to a project, especially in a bigger project.

Is this example application demonstrating best practices for a simple app, or have things changed since the  demo created?

I would like to start doing things the right way, but I don't want to start down a path,  and then discover the mvp4g has changed, and there are better ways to do things...

Thanks!
Mike.




Frank Hossfeld

unread,
Apr 5, 2016, 7:07:37 AM4/5/16
to Mvp4g
Hi Mike,

I just take a look at the EmployeeAdmin example. 

Well, I think, using view delegate (reverse mvp) pattern (by using the ReverseViewInterface of mvp4g) is a good idea. It decouples view and presenter much more. This will make it easier to change a widget lib or use different views in the future. 


Instead of using 

@Presenter(view = IUserListView.class)

you can use

@Presenter(view = UserListView.class)

This will avoid the configuratoin in the module descriptor. In the case, there is no need to have a replacement rule. 


I personally prefer the configuration. If you plan supporting different devices with different views or prefer different layouts depending on your customer, haveng ths configuration makes it much easier. 

So, answering your question, I would say, that this is the way, I code my mvp4g apps today. (taht's my personal opinion) 

Frank
Reply all
Reply to author
Forward
0 new messages