arschr wrote:
Quote:
Have you looked down the path of a field having a data source. The data source could be responsible for getting the data from the database, manipulating other fields to get the data, etc.
End Quote:
In what context are you thinking of using this?
I can't say I've thought it through, but on the surface it seems a field get's it's data from somewhere, straight passthrough from database, an expression/function on database side (case when i = 1 then 'sad' else 'happy' end)
or
an expression/function on the client side ([client side fielda] = [serversideside fieldb]/100) or
([client side fieldb] = summary of [client side field x contained in collection hanging off of an entity]
So, my thinking is, that building every field as an expression, many of which are very simple "passthrough" expressions, gives the foundation to build on. The expression language then has to be able to express the kind of things we want to do, on both the server side and the client side. Things like conditionals, arithmatic, agregates, manipulations etc.
Interesting!
There are two things I think: entities on one side and the big pile of all their fields (attributes so you will) on the other side.
Working with entities sees the entity as the item you work and an entity field is just that: the field of an entity.
Working with the fields/attributes, for example in lists, opens up possibilities like aggregates/groupby and expressions which are out of place in the world of the entity.
In the world of fields/attributes I think indeed that working with an 'expression' is more appropriate than working with a 'field' and apply stuff onto that field. In the world of the entity, I think the entity is what you're using.
In v2.0 entityviews will be added and entityviews are filtered / sorted 'views' on an entitycollection. You then can create projections from these views, to datatable, new entities or custom classes, and these projections can contain complex processing logic.
I hope to address the need for function calls and expression fields in entities through the designer for entities, and for field/attribute usage in code for lists, I hope to be able to find a solution for the 'add what you want to a field object' problem, as it's not intuitive.
I like your datasource idea. I don't think it's applicable for the entity world, but for the world where you work with fields/attributes like in typed lists/dynamic lists and also in filters. As everthing internally is build around the field object, it's a bit problematic to say the least to change that and build it around the datasource/expression object, but if I can make a datasource/expression look like a field, we're also done
Thanks for offering this ideas