[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: Re: Defining APIs, best practices.
- From: steve donovan <steve.j.donovan@...>
- Date: Mon, 17 Dec 2012 15:10:14 +0200
On Mon, Dec 17, 2012 at 12:02 PM, Dirk Laurie <dirk.laurie@gmail.com> wrote:
> 1. Properties are stored in a proxy table. A special value `none`,
> unique to each table, is used for properties that have never been
> set.
That's a useful trick.
> 4. Items stored in the table are passed through a filter. Attempting to
> store into an item for which no filter has been defined, is an error.
> The filter itself can also perform checks.
The 'strict structs' I was talking about some time back do that - and
in proxy mode they can additionally do a type check on assignments.
But how about the classic case where a 'property' may or may not be
backed by a method of the object?
The implementation I'm thinking of for Microlight would optionally add
property support (optional because of the extra __index hook needed)
and either map property F to _F (typically for read access) or
get/set_F (useful for non-trivial setters). One can add a family of
properties that write to _F and additionally call some update method
(an aspect-oriented programming trick)
(The other change would be to make extend/update (aka import) work
with n-tables.)
steve d.
- References:
- Defining APIs, best practices., Jorge
- RE: Defining APIs, best practices., Thijs Schreijer
- Re: Defining APIs, best practices., Jorge
- Re: Defining APIs, best practices., Javier Guerra Giraldez
- Re: Defining APIs, best practices., Coda Highland
- Re: Defining APIs, best practices., Javier Guerra Giraldez
- Re: Defining APIs, best practices., Rena
- Re: Defining APIs, best practices., Andrew Starks
- Re: Defining APIs, best practices., Coda Highland
- Re: Defining APIs, best practices., Jorge Visca
- Re: Defining APIs, best practices., Coda Highland
- Re: Defining APIs, best practices., Dirk Laurie
- Re: Defining APIs, best practices., Coda Highland
- Re: Defining APIs, best practices., steve donovan
- Re: Defining APIs, best practices., Dirk Laurie