What is the use of multiple GWT ActivityManager and ActivityMappers?

It finally came to me that you must create the ActivityMapper code to parse / verify the Place subclass, which is passed to its getActivity(Place) method, and to return the corresponding Activity to present to the user.

So this made me think: it makes sense that you need many different Place subclasses in your application, each of which represents a different bookmark / status URL.

But why does an application need more than 1 ActivityManager and Activity Mapper ? It seems that there is no restriction imposed by the GWT regarding which Place mapped to which Activity ...

I have heard some strategies in which each display area gets its own ActivityManager . I seem to like it too, which makes your project more complex without bringing any real benefits. Thanks in advance!

+4
source share
2 answers

Having encoded an application with 10 such display areas, I can assure you that this made our project much less complicated than what would be with one (we could remove a couple of regions and then process it without any action, but still then).

This turns out to be most useful when your display areas do not all change at the same time (as a rule, your main content changes more often than your peripheral or third-party content): let's say you edit a very complex entity and share it on dozens of screens, and there are things on the screen which are always the same (for example, a summary of the top object to give context to the user).

It is also useful to specialize in your activities (separation of problems, one concern for each event). For example, in stackoverflow (if it is a GWT application), the sidebar on the right may be in the same action as the question and answers, but if you separate things from separate actions, each becomes simpler and therefore easier to maintain.

Finally, specialized events are easier to reorganize. For instance. The master part, divided into 2 actions, can be easily changed from "master / child on one screen" (just like most email clients displaying a list of letters and the selected message) to "go to the child and back to the master" " (for example, GMail is the default, like most mobile applications.) And this reorganization is not related to changing the way you navigate your application, reusing the same actions for different navigation depending on the form factor (and using MVP you also can adapt events without changing the speakers).


That being said, there really are many applications where this is not required / required. This does not mean that it is not useful.

+7
source

Have a look at the article by Thomas Breuer on the topic http://blog.ltgt.net/gwt-21-activities-nesting-yagni/

I tried to implement my idea in a github project: https://github.com/ronanquillevere/GWT-Multi-Activities

+2
source

Source: https://habr.com/ru/post/1445265/


All Articles