medikoo / dbjs

In-Memory Database Engine for JavaScript
MIT License
28 stars 4 forks source link

Introduce construction/extension required properties #76

Open medikoo opened 7 years ago

medikoo commented 7 years ago

/cc @kamsi

It should apply to both creating new classes (extensions), and creating new instances.

Currently we have just required setting, and all it does it prevents deletion of already set properties that have required set to true.

We need a mean, through which initialization of new object (or class) will crash when some properties are not provided to constructor (still at this point I'm not sure what should be the name of property that will mark that)

kamsi commented 7 years ago

@medikoo requiredByDefinition perhaps?

medikoo commented 7 years ago

Or betterrequiredByDefinition ;-) I'm not sure does it say more than required (of which you can also say required by definition).

Probably constructionRequired would be nicer, but I'm not convinced by that name either

mtuchowski commented 7 years ago

mandatory ?

medikoo commented 7 years ago

@mtuchowski I had that in mind as well for a moment, but thought that it sounds just as an alias for `required, still indeed it may be good pick :)