Updated: Proposal for Abstraction Layer for Modifications in

David Miller justdave at bugzilla.org
Sun Jul 25 21:12:35 UTC 2004


Gervase Markham wrote:

> Matthias Juchem wrote:
> 
>>   * Setting the data fields according to the web form fields is done 
>>     via the set_*/add_* functions mentioned below.
> 
> I would instead implement
> set(field_name, "value")
> get(field_name)
> 
> That way, you don't have to change the API of Bug.pm every time we 
> change the fields in the bugs table in the database (which happens 
> reasonably often), and it'll eliminate a lot of duplicated code. You can 
> return a sensible error if the field name is not known.

I strongly second this.  Custom Fields would be much easier to put in 
this way, without having to alter the API, too.  The elimination of code 
duplication (or weird AUTOLOAD hacks) would be a good enough reason in 
itself. :)

-- 
Dave Miller      Project Leader, Bugzilla Bug Tracking System
http://www.justdave.net/             http://www.bugzilla.org/




More information about the developers mailing list