[erlang-questions] Exporting a record type

Gordon Guthrie gguthrie@REDACTED
Fri Jul 10 17:18:19 CEST 2015


Maybe an example would help.

This is the riak_object from Basho’s riak and it is an encapsulated record with exported types and transactional functions that operate on the opaque object:
https://github.com/basho/riak_kv/blob/develop/src/riak_object.erl <https://github.com/basho/riak_kv/blob/develop/src/riak_object.erl>

It is written like this because it is passed around the whole system and persisted to the metal, so opacity and forward/backward changes need to be able to be dropped into the code base with rewriting *everything*

Gordon


> Le 10 juil. 2015 à 16:05, Lloyd R. Prentice <lloyd@REDACTED> a écrit :
> 
> Thanks Jesper and to all who have so generously responded.
> 
> Jesper, can you please expand on the following:
> 
> "Generally you want to avoid module 'foo' to contain getter/setter pairs and define the "transactional" states that can happen to 't'."
> 
> Where would one define getter/setter pairs? What do you mean by "transactional" states?
> 
> Many thanks,
> 
> Lloyd
> 
> 
> Sent from my iPad
> 
>> On Jul 10, 2015, at 7:25 AM, Jesper Louis Andersen <jesper.louis.andersen@REDACTED> wrote:
>> 
>> Generally you want to avoid module 'foo' to contain getter/setter pairs and define the "transactional" states that can happen to 't'.
> _______________________________________________
> erlang-questions mailing list
> erlang-questions@REDACTED
> http://erlang.org/mailman/listinfo/erlang-questions

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://erlang.org/pipermail/erlang-questions/attachments/20150710/ee880814/attachment.htm>


More information about the erlang-questions mailing list