[DGD] Persistent Users
Gary
gary at mups.co.uk
Fri Sep 23 21:53:40 CEST 2016
On 23/09/16 19:18, bart at wotf.org wrote:
> Hi Gary,
[snip]
>
> You can also use an LWO as a proxy to talk to some daemon or service. By doing
> this, you can often create a cleaner abstraction and hide everything behind
> the proxy. Additionally, the proxy object can ensure access checks happen 'at
> the front door', and cache data where this poses no issue with regards to
> modifications of that data.
[snip]
I see what you mean now.
It's a hybrid of the two options I was considering. A proxy object with
no data (avoids issues of LWO copying) but is also not a per field
query-able LWO as it can just return a mapping from the AccountD back to
the caller.
That however makes me wonder if there's much gained by using the LWO
proxy over directly querying AccountD->find_account(name) and receiving
a copy of the mapping back?
Aside from being able to treat the entire mud account system as a
mapping that is. Which in itself may be a good enough reason.
On the other hand, if the LWO represented one specific account's info
and provided additional convenience methods, as a contrived example,
assume it had a simple "fullname" function that concatenated and
returned "first name" and "last name" from the mapping. Then it could
cache the mapping returned by the AccountD and operate on the cached
data without additional AccountD related lookups.
Assuming of course there's a suitable way to invalidate the cache should
the AccountD information be changed.
I suppose as far as account data goes, the access will likely be
infrequent enough that if the pure proxy approach was taken, multiple
lookups due to any additional convenience methods would be tolerable
(avoiding having to manage a cache), but it seems like this style of
design could crop up in other areas of the mud where avoiding extra
lookups could be more important.
Regards,
Gary
More information about the DGD
mailing list