Prodigious-Aim-Solutions / Kronicle6

A Framework for creating web applications with a focus on REST driven SPAs using ES6
http://prodigious-aim-solutions.github.io/Kronicle6
GNU General Public License v2.0
0 stars 0 forks source link

Are Views Necessary? #23

Open Corbzilla opened 9 years ago

Corbzilla commented 9 years ago

Is the View class necessary. At the moment, they are a virtual copy of the component class.

Corbzilla commented 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.