lrsxcd / vip-repl

Clojure View-Interact-Pull REPL
1 stars 0 forks source link

Do we need a generator? #4

Open davidvoler opened 5 years ago

davidvoler commented 5 years ago

Do we need a generator at vip-repl? The generator is a software component, part of the architectural design, not necessarily a microservice. In many frameworks and libraries (is vip-repl a framework? or a library? this is a question for another discussion) you have a mechanism to generate pages, Django, for example, has the view/template mechanism, angular, which is a client-side mechanism has a similar view components mechanism. The idea is that that you combine data, configuration, and design to produce the view. In other words data, HTML, CSS and functionality the generate the final view. The generator is implicit when you call the vip-repl API and ask to create a map and a chart and a single filter (zoom in and out) that controls both the chart and the map. The following tasks are done by the Generator:

  1. generate the js and CSS required for the libraries we use for a map and a chart.
  2. generate the map and chart components
  3. Generate the filter component
  4. assign functionality to the filter

What if we work without a generator? Do we need to load all possible JS/CSS libraries we support - as we do not know which of them we are going to use? Use Clojure script to generate visual elements and functionality ( it is a generator only implemented on the client side)?

Let me know your comments

daslu commented 5 years ago

Thanks, @davidvoler .

If I understand correctly, by Generator you mean a function that returns the page content (represented as a Hiccup data structure, probably).

This seems like the straightforward way to do what we want imho.

davidvoler commented 5 years ago

It returns a webpage with a hiccup template, but also takes care of packaging requires js and css.