@anonymous: "Hi All,
How can a mediator set a value in my model. I have the following code:
unit 1
TMyModel = Class
.
.
published
  property Synchronize  : boolean read FSynchronize write SetSynchronize;
  property EnableRollOver  : boolean read FEnableRollOver write
SetEnableRollOver;
.
.
end;
unit 2
  TCheckBoxMediator = class
  private
    procedure OnClick(Sender: TObject);
  public
    constructor Create(const aControl: TControl);
  end;
 implementation
 constructor TCheckBoxMediator.Create(const aControl: TControl);
 begin
   if aControl is TCheckbox then
     (aControl as TCheckBox).OnClick := Self.OnClick;
 end;
 procedure TCheckBoxMediator.OnClick(Sender: TObject);
 begin
   with Sender as TCheckbox do
      ???? Set property of my model ????? := (Sender as TCheckBox).Checked;
 end;
How can I set the property from TCheckBoxMediator.OnClick. I feels like a
stupid question but I can't figure it out. Hope somenone can help me.
Thanks a lot,
Bart"
    @joanna: ""Bart" <@> a �crit dans le message de news:
<email_address>
|I was looking for a way to keep my mediaters generic. With this solution I
| have to adapt them to each new model I am using. Or am I wrong (I hope so
| :)?
Because Mediators would have to cope with string, integer, boolean, etc; no 
it would not be possible to make them generic. In order to create Mediators, 
one for each control/property, you can use a Factory that takes the type 
that you wish to mediate and returns a Mediator for that combination.
Joanna
Joanna Carter [TeamB]
Consultant Software Engineer"
    @anonymous: "Hi Iman,
Thanks for your effort. You really helping me :-)
Let me see if I understand things right.
In the model you don't declare properties any more
Instead you are holding a list with propertie objects
So when this is true, my mediatior (which would become a controller more 
likely) can actualy sort of configure my model with the needed fields. At 
the same time it is able to 'hook' up the controls from the view. And what 
is more, a persistence framework could more easily do his job.
Iman if you are willing please publish your 3rd incarnation. I am verry 
curious.
Thanks a lot again,
Bart "
    @ilcrawfordathotmaildotcom: ""Bart" <@> wrote in news:438f5b5a$<email_address>:
<quote>
You still have a property for your object, you just store its values in 
the  property list.  For example you would still be able to do 
myObject.ObjectId := someGUID;
I wouldn't go that far.  I would still have objects like
TMyObject = class(TBaseObject)
private
  function getString: string;
  procedure setString(AValue: string);
public
  property myString: string read getString write setString;
end;
The mediator can get and set properties through the property list.
It does make persisting less coding.
Will do.  It will have to wait for until tonight or this weekend.
FYI, it's not really production ready.  It's just a hobby project I work 
on in my spare time.  I'm still struggling with handling filtering and 
sorting lists of objects.  Playing around with ECO has given me a few 
ideas to try out.
Iman"
    @joanna: ""Bart" <-> a �crit dans le message de news: 
439008a2$<email_address>
| Thanks for your response. But when I am googling I get 60 hits each
| containing a lot of messages.
|
| And since I am not as much talented as some of you it would be verry nice 
if
| you could post a working example.
Start here :
<url>
Watch for wrapping in the link.
If you need more info, then persist in looking through the Google entries, 
also look for "attribute framework joanna".
Joanna
Joanna Carter [TeamB]
Consultant Software Engineer "
    @ilcrawfordathotmaildotcom: ""Joanna Carter [TeamB]" <email_address> wrote in
news:<email_address>: 
<quote>
Agreed.  While testing it, I've found you usually only need to get/set the 
actual type, or a string. 
Iman"
{'source': 'USENET', 'other_information': '{"reply_count": 5, "forum_name": "borland.public.delphi.oodesign.20150814.mbox"}', 'file': 'data/output/usenet-borland.public.parquet'}