Mackiovello / BlendingDemo

0 stars 1 forks source link

Initial impressions #1

Open warpech opened 7 years ago

warpech commented 7 years ago

Thanks @Mackiovello so much for doing this. I really wish that this meets HelloWorld half-way and becomes a single learning track that includes blending.

  1. build.bat and run.bat would be helpful
  2. Is enum type officially supported? It is not on the page https://docs.starcounter.io/guides/database/datatypes/ (cc @k-rus)
  3. Anyway, an app that does not use enum would be even simpler
  4. HelloWorld is more advanced, because it shows calculated properties (CurrentBalance). That is an eye-opening example of a very powerful feature. On the other hand, "expenses" theme of the current HelloWorld is much more boring than a list of pets. Maybe we can combine having pets and calculated properties?
  5. Blender.MapUri should rather map to a database class: Blender.MapUri<PetOwner>("/PetOwnerList/partials/PetEntry/{?}");
  6. Blending in this demo seems to be too simplified. The preferable convention is to blend based on data, not arbitrary strings (such as PetEntry).

I think that this has huge potential to replace the current HelloWorld with something much more interesting!

Mackiovello commented 7 years ago

build.bat and run.bat would be helpful

Agree

Is enum type officially supported? It is not on the page https://docs.starcounter.io/guides/database/datatypes/ (cc @k-rus)

Isn't an enum basically an integer underneath?

Anyway, an app that does not use enum would be even simpler

Agree

Blender.MapUri should rather map to a database class: Blender.MapUri("/PetOwnerList/partials/PetEntry/{?}");

What's the benefit of mapping to a database class over a string token?

Blending in this demo seems to be too simplified. The preferable convention is to blend based on data, not arbitrary strings (such as PetEntry).

Agree

I'm also working with out summer intern to extend the HelloWorld app for blending, it's still ongoing. You can find it here: https://github.com/philipborg/HelloWorld

I'm trying to wrap my head around blending and how to represent it so that it makes sense. This is one attempt at it. The HelloWorld fork linked above is another.

A question I'm asking myself is how complex it should be. For example, blending with parameters/collections is way more complex than just blending without any parameters. Should the tutorial present the simpler or more advanced alternative? I'm leaning towards the simpler choice. Although, a more complex example might be better at highlighting the power of blending.

Doing this example made me question if it's correct to build on HelloWorld for blending or if using two separate applications might be better. I'm afraid that building on HelloWorld might limit us. That deserves some more thought, though.

Again, this is very much work in progress. I'm doing everything I can to get a great tutorial and blending guides as soon as possible since it seems to be requested from a lot of different sources. My goal is to make blending something that everyone wants to use in their apps.

warpech commented 7 years ago

What's the benefit of mapping to a database class over a string token?

When the apps come from different vendors, they will not be able to agree on subjective terms such as string tokens or shared data models. The only surface that can give the context for the views is the data mapping.

A database class is the C#'s metaphor for the data model, so this is the thing that will represent the data mapped to your class.

In other words, plain string tokens are dumb. Database classes are semantic, they represent understandable kinds of information.

A question I'm asking myself is how complex it should be. For example, blending with parameters/collections is way more complex than just blending without any parameters. Should the tutorial present the simpler or more advanced alternative? I'm leaning towards the simpler choice. Although, a more complex example might be better at highlighting the power of blending.

Perhaps there we have our tutorial:

  1. Blending to a string token, without parameters ("app icon" or "settings" page works this way)
  2. Blending to a string token, with parameters ("search" in Launcher works this way)
  3. Blending to a database class, with parameters (I think you cannot even have it without parameters)

Again, this is very much work in progress. I'm doing everything I can to get a great tutorial and blending guides as soon as possible since it seems to be requested from a lot of different sources. My goal is to make blending something that everyone wants to use in their apps.

This is an great goal to have. Please continue!

k-rus commented 7 years ago

enum works. I don't know what will be consequence of documenting it and making official. I guess should not be a problem as we are supporting DateTime. It requires some better strategy with meta-data.

Side question, why is it a personal repo, not another repo in Starcounter?

Mackiovello commented 7 years ago

Side question, why is it a personal repo, not another repo in Starcounter?

Because this was basically a way for me to test blending in an isolated setting without polluting the Starcounter organization. If this will be used for a tutorial or something like that, it will be moved to the appropriate repo.