siteName > > flux
Threads
java ( 176262 ) - com.iluwatar.fl ( 176313 ) stack: com.iluwatar.flux.app.App.main(App.java:55) org.codehaus.mojo.exec.ExecJavaMojo.doMain(ExecJavaMojo.java:385) org.codehaus.mojo.exec.ExecJavaMojo.doExec(ExecJavaMojo.java:374) org.codehaus.mojo.exec.ExecJavaMojo.lambda$execute$0(ExecJavaMojo.java:296) java.base/java.lang.Thread.run(Thread.java:840)
/*
 * This project is licensed under the MIT license. Module model-view-viewmodel is using ZK framework licensed under LGPL (see lgpl-3.0.txt).
 *
 * The MIT License
 * Copyright © 2014-2022 Ilkka Seppälä
 *
 * Permission is hereby granted, free of charge, to any person obtaining a copy
 * of this software and associated documentation files (the "Software"), to deal
 * in the Software without restriction, including without limitation the rights
 * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
 * copies of the Software, and to permit persons to whom the Software is
 * furnished to do so, subject to the following conditions:
 *
 * The above copyright notice and this permission notice shall be included in
 * all copies or substantial portions of the Software.
 *
 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
 * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
 * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
 * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
 * THE SOFTWARE.
 */
package com.iluwatar.flux.app;

import com.iluwatar.flux.action.MenuItem;
import com.iluwatar.flux.dispatcher.Dispatcher;
import com.iluwatar.flux.store.ContentStore;
import com.iluwatar.flux.store.MenuStore;
import com.iluwatar.flux.view.ContentView;
import com.iluwatar.flux.view.MenuView;

/**
 * Flux is the application architecture that Facebook uses for building client-side web
 * applications. Flux eschews MVC in favor of a unidirectional data flow. When a user interacts with
 * a React view, the view propagates an action through a central dispatcher, to the various stores
 * that hold the application's data and business logic, which updates all the views that are
 * affected.
 *
 * <p>This example has two views: menu and content. They represent typical main menu and content
 * area of a web page. When menu item is clicked it triggers events through the dispatcher. The
 * events are received and handled by the stores updating their data as needed. The stores then
 * notify the views that they should rerender themselves.
 *
 * <p>http://facebook.github.io/flux/docs/overview.html
 */
public class App {

  /**
   * Program entry point.
   *
   * @param args command line args
   */
  public static void main(String[] args) {

    // initialize and wire the system
    var menuStore = new MenuStore();
    Dispatcher.getInstance().registerStore(menuStore);
    var contentStore = new ContentStore();
    Dispatcher.getInstance().registerStore(contentStore);
    var menuView = new MenuView();
    menuStore.registerView(menuView);
    var contentView = new ContentView();
    contentStore.registerView(contentView);

    // render initial view
    menuView.render();
    contentView.render();

    // user clicks another menu item
    // this triggers action dispatching and eventually causes views to render with new content
    menuView.itemClicked(MenuItem.COMPANY);
  }
}
Variables All
No.FromNameValue
155args[Ljava.lang.String;@6506b39e
END 0 00
Output All Filter Merge
Process FilterThread Filter
176262 java 176313 com.iluwatar.fl
No.PNPIDTIDTNTLMessage
1java176262176313com.iluwatar.flcom.iluwatar.flux.view.MenuViewI* Home
2java176262176313com.iluwatar.flcom.iluwatar.flux.view.MenuViewIProducts
3java176262176313com.iluwatar.flcom.iluwatar.flux.view.MenuViewICompany
4java176262176313com.iluwatar.flcom.iluwatar.flux.view.ContentViewIProducts - This page lists the company's products.
5java176262176313com.iluwatar.flcom.iluwatar.flux.view.MenuViewIHome
6java176262176313com.iluwatar.flcom.iluwatar.flux.view.MenuViewIProducts
7java176262176313com.iluwatar.flcom.iluwatar.flux.view.MenuViewI* Company
8java176262176313com.iluwatar.flcom.iluwatar.flux.view.ContentViewICompany - This page displays information about the company.
END 0 0 0 0 0 00
Project:JavaDesignPatterns
Update:20240509
Commit:bf6456ba6
Source Code:flux
BuildTool:Java17
Compiler:Java17
Runtime:Openjdk17
System:MySystemD
Kernel:Linux5.10.211
Cpu:Intel:Corei7-7700K
Machine:AwesomeMachine