mardi 17 mai 2016

which pattern for a class with two attribute that depend from the other

I want to create an item event. This item event will be editable.

Each item event has a type and an eventValue.

There is three type of items (pressKeyEvent, releaseKeyEvent, delayEvent)

For the pressKeyEvent and the releaseKeyEvent the user can only select a keyObject as eventValue.

For the delayEvent the user can only select a integer as eventValue.

What kind of pattern should be used in this case knowing that the user can always change the itemEvent.

Thanks for your suggestions :)

Aucun commentaire:

Enregistrer un commentaire