Cratis / Chronicle

Event Sourcing database built with ease of use, productivity, compliance and software evolution in mind.
https://cratis.io
MIT License
25 stars 5 forks source link

Move away from Guid identifier for RulesFor #1203

Open einari opened 3 weeks ago

einari commented 3 weeks ago
woksin commented 3 weeks ago

@einari Shouldn't the task simply be to change RuleId to be a concept of string and change the RuleAttribute instead of introducing a new Rules attribute?

woksin commented 3 weeks ago

Ohh, I think I see now why we need the Rules attribute for the RulesFor type

einari commented 3 weeks ago

Yeah.. This is actually something I had forgotten about. Its two different use-cases. It doesn't make sense to have two attributes with the same name.

For the existing RuleAttribute we just want to make the Identifier property optional. Default behavior should then be that its identifier is the types fullname (namespace + type name).

The other use case is for a RuleSet, I suggest we call the attribute for this issue RuleSetAttribute.

woksin commented 3 weeks ago

There a bit mix here in how it's used, for instance RulesFor is for a type, while RuleAttribute is for a property or parameter, thus the strategy of getting the identifier from the type name does not really work? Also the IRule interface with the Identifier probably won't really work with all of these scenarios, so I think there has to be some more thinking behind this. This was a bit more challenging than I anticipated... 😆