Re: A few observations and questions regarding iModifiable entries
Christian Van Brussel <[email protected]>
| Newsgroups | gmane.comp.graphics.crystalspace.devel |
|---|---|
| Organization | UCL - TELE |
| Message-ID | <1338299320.2012.1751.camel@scylla> |
On Mon, 2012-05-28 at 19:50 +0300, Andrei Bârsan wrote: > The wiki page states that iModifiableParameter only has GetName, > GetDescription, GetType and GetConstraint. What about the actual value? That's just the example that is not complete and that was only showing the main functionalities of the iModifiable to set/get values. Other topic: the methods GetName() and GetDescription() should probably be removed from the iModifiableParameter interface, and be read from the iTranslator instead, using a key built from the ID's of the iModifiable and the parameter. A generic mechanism should therefore be defined in order to store and manage these translations and translations keys. > Also, if one parameter has its own id and value, why do those methods > need to take an additional csStringID parameter, in addition to the > actual value the parameter needs to receive? The value from iModifiableParameter::GetID() is the same that the one used in iModifiable. The goal of the former method is to get an easy access to the ID from a iModifiableParameter, otherwise this value has to be cached manually. If this behavior is considered acceptable, then the method GetID() can be removed. > I understand that we might need to implement our own > Get/SetParameterValue functions for slightly more advanced cases (like > the csGenmeshMeshObject example on the wiki), but shouldn't there still > be some basic built-in functionality for very simple cases? Yes clearly. Every implementation of the iModifiable will use quite a lot of code that can be commonly shared in a tool class. The design of such tool classes is however still not clear, and this may be made once you implemented a first set of iModifiable's, so that we can see what are the actual needs. > Another question would be why does iModifiableDescription need to be > able to get parameters? (it has GetParameter(...) and > GetParameterByIndex(...) methods) Shouldn't the just iModifiable object > have a list of parameters? The interfaces iModifiableDescription, iModifiableParameter and related should be used only by objects that do not know a priori how to use the iModifiable, eg typically tools such as your GUI generation tool. The actual value of the parameters is stored only in the iModifiable, the other interfaces are accessed (and allocated in memory) only if needed. ------------------------------------------------------------------------------ Live Security Virtual Conference Exclusive live event will cover all the ways today's security and threat landscape has changed and how IT managers can respond. Discussions will include endpoint security, mobile security and the latest in malware threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/ _______________________________________________ Crystal-develop mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/crystal-develop