Lately I have been doing some thinking on the 'action' part of Objects.
Objects have properties. But how do you describe an action or an occurrence?
When the accelerator is pressed, the car moves.
One way I thought is that there could be an Observer object.
The Accelerator is subscribed to the Observer.
Upon Creation, Update or Delete of the target object, say A, a sequence of actions have to take place.
I was trying to find a structure for this.
Also CRUD events of A can be initiated by itself or another object B
So to start off, there has to be a table
Id -> unique eg= 7
Action -> Create/update/delete
TargetObj-> A
CallerObj-> A
for event id 7,
properties of [A], say A1,A2,A3.. have to be populated with values.
The structure for this operation needed a lot of thought and was quite frustrating.
(Yes I know exact same thing has been done before by someone, but I cannot find that information, nor is there anyone to guide)
Ok, getting back.
The key conclusions I derived are the following.
Upon event concerning [A],
A specific property of [A], say A1
can have
i- A static value
OR
ii- Value equal to a specific Property of a specific Object whose instance is dynamic
OR
iii- Value equal to a specific Property of a specific Object whose instance is static
To explain,
(i) is easy. Self explanatory
(ii) Property A3 = Property C3 (of object C, instance of which is derived through a property of A)
(ii) Also self explanatory.
Well if anyone has any queries or suggestions, please comment.
Objects have properties. But how do you describe an action or an occurrence?
When the accelerator is pressed, the car moves.
One way I thought is that there could be an Observer object.
The Accelerator is subscribed to the Observer.
Upon Creation, Update or Delete of the target object, say A, a sequence of actions have to take place.
I was trying to find a structure for this.
Also CRUD events of A can be initiated by itself or another object B
So to start off, there has to be a table
Id -> unique eg= 7
Action -> Create/update/delete
TargetObj-> A
CallerObj-> A
for event id 7,
properties of [A], say A1,A2,A3.. have to be populated with values.
The structure for this operation needed a lot of thought and was quite frustrating.
(Yes I know exact same thing has been done before by someone, but I cannot find that information, nor is there anyone to guide)
Ok, getting back.
The key conclusions I derived are the following.
Upon event concerning [A],
A specific property of [A], say A1
can have
i- A static value
OR
ii- Value equal to a specific Property of a specific Object whose instance is dynamic
OR
iii- Value equal to a specific Property of a specific Object whose instance is static
To explain,
(i) is easy. Self explanatory
(ii) Property A3 = Property C3 (of object C, instance of which is derived through a property of A)
(ii) Also self explanatory.
Well if anyone has any queries or suggestions, please comment.
Comments
Post a Comment