I am creating a class (foo) for a single purpose - it contains only properties and is designed to be passed around as a parameter instead of a temp-table record or a buffer handle
Is there any special names for this kind of class ?
data.foo()
properties.foo()
wadaymachallit.foo()
Imsurehtatdrhurshwillhavesomecommenttomakeaboutthis.foo()
Julian
jmls wrote:
I am creating a class (foo) for a single purpose - it contains only properties and is designed to be passed around as a parameter instead of a temp-table record or a buffer handle
Is there any special names for this kind of class ?
data.foo()
properties.foo()
wadaymachallit.foo()
Imsurehtatdrhurshwillhavesomecommenttomakeaboutthis.foo()
Julian
What's common about the properties? That should be at least somewhat suggestive of a name.
And out of curiosity, how is it being passed (and where)?
-- peter
They are all related to a specific function. For example, the class below is used for answermachine records
USING Progress.Lang.*.
CLASS pbx.data.AnswerMachine:
DEF PUBLIC PROPERTY MailBox AS INT NO-UNDO GET . SET .
DEF PUBLIC PROPERTY MailboxName AS CHAR NO-UNDO GET . SET .
DEF PUBLIC PROPERTY AnswerMachineGUID AS CHAR NO-UNDO GET . SET .
DEF PUBLIC PROPERTY EmailAddress AS CHAR NO-UNDO GET . SET .
DEF PUBLIC PROPERTY Password AS CHAR NO-UNDO GET . SET .
END CLASS.
The phone system makes a request for answermachine data via webspeed - rather than the agent reading the database directly, it calls a method in a library and returns a class of "pbx.data.AnswerMachine", which the agent that interrogate the properties of and send back the relevant information,
This is a simplistic example (but, for example, email address may be generated from a set of business rules in the library method rather than a field in the AnswerMachine table)
/* webspeed agent */
....
DEF VAR Answer1 AS CLASS pbx.data.AnswerMachine NO-UNDO.
Answer1 = pbx.lib.AnswerMachine:Instance:Get(get-field("ANSWERMACHINEGUID")).
{&out} SUBSTITUTE("&1:&2",Answer1:MailboxName,Answer1:EmailAddress).
DELETE OBJECT Answer1.
...
An object with properties and no behavior is called a Value Object.
ah hah. Thanks.
What about if this class has either a getter on a property or a method that manipulates only the properties of said class ?
is this also the same thing ?
Yes
If you add behavior, it won't be a pure value object any more. But, that doesn't mean that you can't have logic in properties, e.g., different properties for degrees or radians, computed from the same value.
OK! I officially lay claim to being the person that has produced the shortest ever response from Thomas
No-one can ever beat that - except a "No" I suppose ...
Don't forget that Tom B. has had a couple of completely blank replies recently ...
that only counts if you were genuinely speechless
Parameter object is also a common term.