Open Corbzilla opened 9 years ago
One possible solution is to remove the events from the View class and make them a holder for components. Therefore best practice would be to not have the View respond to any events only it's components. This may suggest that removing the sub-components from components as we would only have Views made up of components. Each component in the View should be the constructed as the smallest possible version of itself. The View could end up being a container for state information making it almost a ViewModel.
This suggest a general structure for large apps consisting of a traditional MVC architecture with each view containing a Flux style setup. If so, we may need to add, possibly to the tooling, a way to create/deploy a simpler View structure for simpler apps or websites. Perhaps a static site generator? This would be necessary to maintain the most flexibility and choice for the developer.
Is the View class necessary. At the moment, they are a virtual copy of the component class.