Thanks for the input everyone. One thing I'm wrestling with is whether to
use my deserializer/validator to go to app-level dicts or straight to
SQLAlchemy objects. I'm not sure yet whether the service/action layer
should work with SQLA objects all the time. Thoughts on that?

thanks
iain

On Thu, Jun 9, 2016 at 10:43 AM, Jonathan Vanasco <[email protected]>
wrote:

> In our largest app we have a caching layer and do a lot of transitions
> between SqlAlchemy and a Dict (both directions)
>
> some of these may apply to you:
>
> 1. dicts are wrapped in an 'attribute safe' container, so they behave like
> sqlalchemy objects.  certain sqlalchemy relationships are handled via
> lazyloading cache items from a readthrough cache.
>
> 2. there is a per-request local cache of dict objects.
>
> 3. the dict containers have a 'readonly' flag, so they raise errors if we
> try to write.  the system loads a fresh sqlalchemy object when it needs to
> write, then updates the cached items.
>
> 4. there is a single method for converting the objects from one type to
> another.  after a while, it made more sense to keep the mapping logic
> between the two object types instead of nested into one.
>
> --
> You received this message because you are subscribed to the Google Groups
> "pylons-discuss" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to [email protected].
> To post to this group, send email to [email protected].
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/pylons-discuss/2a6a8c2d-1d00-4ba9-b99e-2de88be16d56%40googlegroups.com
> <https://groups.google.com/d/msgid/pylons-discuss/2a6a8c2d-1d00-4ba9-b99e-2de88be16d56%40googlegroups.com?utm_medium=email&utm_source=footer>
> .
>
> For more options, visit https://groups.google.com/d/optout.
>

-- 
You received this message because you are subscribed to the Google Groups 
"pylons-discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/pylons-discuss/CAN9NcLz8rjPTHK8wFrG97Hnx-UBB_K7GJ97UUZRSTb4WOZA6hA%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to