2007/10/29, Ali Afshar <[EMAIL PROTECTED]>: > Well, although it's close, I think it's a model thing not view. View > renders the actual data, model should decide what the view renders. > What's right and wrong though is a bit irrelevant, since it works > well, is simple to understand, and is very maintainable. > > Let me give an example. What happens when you want to create a web > view for the same model. Surely it would be useful to not have to > reimplement the accessor for each type of view?
That's what I'm talking about, let me give you an example of what I'm needing: I have a Planet class that's part of my model. One of its attributes if "temperature", and its value is stored in ÂșC degrees. On one type of planet view, I would like to show a ProxyLabel widget showing just that value: in degrees. On another kind of planet view I would like to show something like "warm", "hot", "cold"...depending on temperature ranges. If this output is decided on the model, I'm screwed! because I'll have to write one "formatting method" on the model for every type of view, on the other hand, if the ProxyWidgets give me some way to render the value as I would like to, that would be the optimal solution (as I see it), every different view will decide how to show the value. I don't know what's the case with the other ProxyWidgets, but the case in ProxyLabel is that I can make this replacements globally on the ProxyLabel class, and not for every instance. I could subclass ProxyLabel and implement my replace() method, but I won't be able to use that subclass from gazpacho :-( the strange thing is that this case is not supposed to be an exceptional one. Best regards -- Lucas Di Pentima - http://lucas.di-pentima.com.ar GnuPG Public Key: http://pgp.mit.edu:11371/pks/lookup?op=get&search=0x6AA54FC9 Key fingerprint = BD3B 08C4 661A 8C3B 1855 740C 8F98 3FCF 6AA5 4FC9 _______________________________________________ Kiwi mailing list [email protected] http://www.async.com.br/mailman/listinfo/kiwi
