Giter Site home page Giter Site logo

vaadin-mvp-lite's Introduction

MVP-Lite

MVP-Lite is a Vaadin add on to build Model-View-Presenter based applications. You can find a tutorial in the wiki.

We built an demo Vaadin-App that simulates an web-email client. Durring this tutorial we try to explain the most components and make examples by refering to this example app. The complete code of the demo app can be found here on github. At the end of this tutorial you should be able to use our MVP-Lite framework to build well designed (software pattern) Vaadin applications.

Chapters

  1. It all starts with the EventBus
  2. Model-View-Presenter: The Basics
  3. Model-View-Presenter: Using MVP-Lite
  4. View-Hierarchy and ShowViewEvents
  5. Navigation
  6. GlobalEventBus: Real time communication

vaadin-mvp-lite's People

Contributors

alin-dev avatar asm0dey avatar sockeqwe avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

vaadin-mvp-lite's Issues

Can I use multiple instance of EventBus + Breadcumbs

Hello sockeqwe,
Is it possible to use the EventBus + Breadcrumbs as multiple instances, my use case is something like the following. I have multiple tabs in my application(better term workspaces), and I wish to keep separate Event Bus and breadcrumbs for each workspaces/tabs. Is that possible?

A question regarding EventBus.removeHandler(handler)

This method does not work correct, even after I removed a handler it's getting fired I hope there is a minor bug. But please let me know if this is already fixed, but when I downloaded latest jar, this bug is still there ! Can you please check this? and I am not using Vaadin 7

My changes and a question

Hi @sockeqwe .

Im using a modified version of your EventBus here. Thanks, it is helping me a LOT. When my changes become stable, I will offer it to the project, and if you think that it haves any clue to your component proposal, i will be happy to contribute :).

Basically, my changes are:

  • A division little division:
    • Handler Manager (manages the envent handler registration and dispatching, but does not permit fire events over it). Its only to listen and respond for events.
      • An Application Handler Manager, that can be attached to the application context, allowing users to create application scoped handlers that will will receive application events.
      • An Session Handler Manager, that can be attached to any Vaadin Session, so the user can attach session scoped handlers that will have same lifecicle as the Vaadin Session. It will receive application and session scope events.
  • EventRouter
    • Allows users to fire events over it, bind other EventRouters on it, but not allow handler registrations. This is useful to memory management, avoiding a handler registration on a global object.
      • Session Router: A EventRouter that can have one instance per Vaadin Session, and is bound to application router, to receive global events (Like your GlobalEventBus). Events fired here, is delivered to all connected EventBus.
      • Application EventRouter (A Event Router proposed to be used as a singleton on a application. Events fired here is routed to all event routers, and in all their binded EventBus'es.
  • EventBus - Is a EventRouter and a HandlerManager, to be used in a component scope, like in a Presenter. It can be bound to the SessionRouter, to receive Session and Application Scope events. It can be used to fire events locally, or in session or application.

Well, its only a hierarchical separation with few implementations, but it is helping me, a lot. Now even more with Push Events, that can traverse session and application context.

About my Question.
How you deal with Generic Events? Like:

EntitySavedEvent

eventBus.fireEvent(new EntitySavedEntity(person));
eventBus.fireEvent(new EntitySavedEntity(book));

Firing this two events will deliver the event to any EntitySaveEntity Handler, and if it is not expecting a Person or a Book, it will cause ClassCast Exceptions!

Thanks a lot!

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.