--
You received this message because you are subscribed to the Google Groups "glorp-group" group.
To unsubscribe from this group and stop receiving emails from it, send an email to glorp-group...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/glorp-group/920e36be-7f6c-46f9-a9cf-9a2ee14c8738n%40googlegroups.com.
To view this discussion visit https://groups.google.com/d/msgid/glorp-group/a042f4c9-7525-4fdd-a08d-2c4a29a9a268n%40googlegroups.com.
Hi Alan,
thanks for your thoughts. Seems there are quite a few models for using Views. The ones you reference are not ones I had in mind. Maybe that's a first indicator for this whole thing not being too easy...
What I had in mind was using dedicated classes that do not
inherit from or reside in the same inheritence hierarchy as "real"
business oobjects. In my case I want them to be used for long
lists from which you can edit the "real" objects by
double-clicking.
Think of a page like "Top 5o customers of last quarter". I want their name, address, sum of their purchases of the last quarter, maybe their most expensive with date and sum. These are based on a more or less complex (maybe materialized) view. I want the possibility to click on their name to edit/view more details, a link to see the complete list of orders of the quarter and a link to add a note or whatnot. These referenced objects should be the real mapped and cached business objects, so that they can be treated in the current unit of work. But the view objects are neither needed in the cache nor will they ever be updated. (Maybe I am wrong in assuming I don't want them cached, because I might want to ensure their "identitity" if the view is refreshed - my current implementation has no primary key for the view objects, let's see if that is a good decision or not...)
So this to me sounds like a much simpler scenario than what you
describe. So far, I like the results without modifications to
Glorp, but I am wondering if such objects tend to flood caches and
make the registration of transitive closures much more expensive
than needed. Glorp will have to keep all the attributes like
customer name, their street and city and whatnot in its caches at
least once more for the view object and for the real business
objects. So the streat and customer name will be kept in the undo
maps for the business object (if it's proxy is resolved from the
view object) and the view. so it will be in the caches at least 4
times....
I was wondering if that can be avoided by keeping a mapping read-only, meaning: don't keep the initially read value for updates that won't occur anyways. This would eliminate 2 copies of the String in my naive understanding (old value as read froim the DB and the one that is created when the row is prepared for possible updates).
The second idea I tried to describe was that maybe such a read-only object is always an end point for registering a transitive closure of objects.
It holds the roots of several object "trees", like the Customer
and its address, orders etc. and the list of orders of the last
quarter. These trees are possibly completely unrelated and will be
tracked by Glorp anyways, even if a View object itself doesn't
provide anything to the register transitive closure operation. Am
I right? And if they are related, they will probably be found in
the register transitive closure phase anyways. )Pleas note: by
"related" I mean a link between the two trees through a path of
resolved proxies / real objects). So my idea was (but I forgot to
mention) that a view / read-only object behaves like a Proxy that
is not resolved yet. It is an endpoint to the traversal of
possible candidates for DB changes.
I am not completely sure about this, however. So I would like to discuss this and probably find co-warriors to extend Glorp towards read-only-mappings...
(bringing us back to the question which code base would be the
one to do this in: VW / Pharo / VAST)
Not sure about your "cached forever" comment. Once a read-only
object is materialized, there is no need to cache it any more. The
instantiated Object is caxche enough. What may be needed is teh
ability to refresh such a read-only object, but I see no need to
cache it. It's read only, so I assume it doesn't change. And if it
does, I assume I never want to write these changes back to the DB.
So it can be detached / transient or whatever you'd like to call
it. Wrong?
Joachim
You received this message because you are subscribed to a topic in the Google Groups "glorp-group" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/glorp-group/Zh23rVNtOSs/unsubscribe.
To unsubscribe from this group and all its topics, send an email to glorp-group...@googlegroups.com.
To view this discussion visit https://groups.google.com/d/msgid/glorp-group/CAGWHZ9_Gc7N6g89wC2j9kEhEHoBZjw_b103hAcSWw88C%3D05d8Q%40mail.gmail.com.
-- ----------------------------------------------------------------------- Objektfabrik Joachim Tuchel mailto:jtu...@objektfabrik.de Fliederweg 1 http://www.objektfabrik.de D-71640 Ludwigsburg http://joachimtuchel.wordpress.com Telefon: +49 7141 56 10 86 0 Fax: +49 7141 56 10 86 1