Root / Assembly / ARCCore / AREnumType / DocumentationOnlyEnum / ARConcepts / _Member / TaggingOfPropertyKeys



DescriptionThe concept of specifying in a single place all relevant information about a given property (data field).

The purpose is to give 'at-a-glance' information about all relevant aspects of a given property, without having to navigate through a complex code database. And also with the goal of reducing the amount of ApplicationSpecificCode.

Note: You can start using AgoRapide without this concept.
AgoRapide as a storage system is usable without define ANY schema / tagging at all. Just create PropertyStreamLines and see how they immediately gets understood by a standard ARAAPI application.

See PK, / BasePKAttribute where the tagged attributes are stored.

This central concept in AgoRapide (in addition to PropertyStream) ensures that once you have decided that you need a field like for instance 'Customer.FirstName' then all of the functionality (or as much as possible of it) for that field can reside in the C# code where it was originally defined / declared.

TODO: Give som practical examples of what is meant by this.

In the rest of your application logic there should be less need for referring to 'FirstName'. Like implementing setters and getters, reading from and storing to database, logging access, storing historical data, UI-presentation (including transformations and joins), input-validation and so on.

In other words, all application logic related to 'FirstName' should reside where 'FirstName' was originally defined, enabling you to at-a-glance ascertain how FirstName is used throughout the application.

If all this can be sewn together in a coherent manner then a huge amount of boilerplate code disappears. This again will help with keeping the complexity of your application down as it matures.
In practise, all this is accomplished by you (the user of AgoRapide) by defining enums tagged as PropertyKeyEnum. (Example: See how StreamProcessorP is tagged as '[Enum(AREnumType = AREnumType.PropertyKey)]'.)

The values of these enum definitions again are tagged through the BasePKAttribute mechanism.
(Example: See how LocalStorageFolder is tagged with PKTypeAttribute's 'Description' and 'IsObligatory'.)

The end-result of all this tagging ends up in a PK instance (which may contain multiple BasePKAttribute instances).
(Example: CountSendMessage is tagged by both a PKTypeAttribute and a PKLogAttribute.)

ARCCore contains some implementations of BasePKAttribute like PKTypeAttribute (which will always be available for a given property) and PKLogAttribute.
The other ARComponents introduce more implementations of BasePKAttribute in order to implement their functionality.
TODO: Give examples here.
You are also strongly encouraged to write your own classes inheriting BasePKAttribute whenever you have code implementing some specific aspects about a property key.

For some easy-to-follow examples of this, see ARCDoc.
LongDescriptionFAQ: Why does AgoRapide tag enum members (enum values) instead of just directly tagging ordinary class properties?
Because it gives greater flexibility, especially with PropertyAccess.
We need the simplest possible mechanism on which to 'hang' the tags, and enum's are perfectly suited for that purpose.
They are easy to refer to and it requires very little use of reflection (or even none at all).
It does however make the classes look strange, they may even be totally empty in many cases.
One example of flexibility is when a class can have lets say 50 members, but you only need to have a Subscription for 5 of those. Initializing the class with 5 properties instead of 50 then takes up correspondingly less memory (because even null-values for ordinary properties will take up at least 8 bytes for each property).

4 items

Generated 2020-10-13 11:11:01.205 UTC