Replies: 3 comments 3 replies
-
I can imagine a future state of Vuu where we could drive code like the above from a purely declarative representation of the table definitions - a json schema for example. I see numerous benefits on the UI side for such a feature. A source of frustration for UI devs on early projects has been periods of server downtime / missing data on Vuu instances that block UI development. To help mitigate this a contribution has been initiated (#849) to provide a client side datasource that implements a working subset of Vuu functionality - sorting, filtering, grouping, aggregations. This also has a facility for quickly generating realistic test data (using Faker.js). As a drop-in replacement for the Vuu-connected RemoteDataSource, this allows UI devs to switch to local data for development when remote data is unavailable. In addition to this, new work on the Vuu UI includes a comprehensive table configuration tool - each column of a table can be configured with data type specifics, formatting suggestions etc. If we used a json document to describe a table definition, this could be shared on the client to guarantee that when client side tables are constructed, they are generated to exactly the same spec as the server tables. This could be taken even further - using the new UI tools to configure a table, we could create an admin tool that allows a table definition to be created with a nice UI, that could be immediately generated as a client table and tested . The json definition created this way could then be exported and used to generate the tables on the server. Would anything in the implementation proposal above prevent us from this kind of approach it we wanted to pursue this. |
Beta Was this translation helpful? Give feedback.
-
I like this approach. I especially like the ability to create rows from the schema. One addition I'd like to do is to hide the immutable map inside the createRow impl. As this would give us the flexibility to change the underlying data structure as we want to. I wonder if there is a way to address the fields using the schema rather than using the strings? RowWithData applicationsSnapshot(JsonObject json) {
return APPLICATION_SCHEMA.createRow(Map.of(
"Application", ReferenceData.applicationKey(json),
"AppName", json.getString("AppName"),
"VersionNumber", json.getString("VersionNo"),
"AppDesc", json.getString("AppDesc"),
"Disabled", json.getBoolean("Disabled"),
"JarFile", requireNonNullElse(json.getString("JarFile"), "[unmanaged]"),
"MainClass", requireNonNullElse(json.getString("MainClassPath"), "[unmanaged]"),
"LastUpdateDt", json.getString("LastUpdDt"),
"ApplicationType", requireNonNullElse(json.getString("ApplicationType"), ""),
"LastUseDt", requireNonNullElse(json.getString("LastUsedDt"), "")
));
} RowWithData applicationsSnapshot(JsonObject json) {
return APPLICATION_SCHEMA.newRow()
.Application("foo")
.AppName("bar")
.VersionNumber(1234)
//etc..
));
} |
Beta Was this translation helpful? Give feedback.
-
Summarising requirements for Table definition
|
Beta Was this translation helpful? Give feedback.
-
This is a proposal for a new API to create Vuu
TableDef
objects, as well as ensure that any data rows added do not refer missing / misspelled columns.We would also like to reduce the number of concepts one has to deal with (especially to declare joins), eliminate the need of using weekly typed DSL's (the
"name:Type"
column notation, or using random types for columns which later fail during serialization). Finally, we need the API to be easy to use from Java, as well as from Scala.The description below is based on the prototype in
vuu-ubs-internal
, which we may open at a later stage.The pseudocode below has been simplified for the sake of illustration (showing only public and protected methods).
This API allows for concise, yet expressive table definitions as follows:
Then later we can use these public schema builders to create rows (and if we mistype any of the columns we will get an easy to diagnose error):
Possible improvements:
done()
to transition from configuration to creation lifecycle phaseBeta Was this translation helpful? Give feedback.
All reactions