Hello,
Under many circumstances I found the need for fields like "createdByUserLogin" and "lastModifiedByUserLogin" on every entity just like the auto time stamp. I wonder your opinion on this and why these were not included in OFBiz Entity Engine yet? I've searched through the mailing list and found just one post on this: http://lists.ofbiz.org/pipermail/dev/2004-November/007083.html But no answer to it. Thanks in advance. -- Best regards, Yan _______________________________________________ Dev mailing list [hidden email] http://lists.ofbiz.org/mailman/listinfo/dev |
It wouldn't be too hard to change the Entity Engine to automatically add these 2 fields to every entity (just like with the time-stamps, and have an attribute on the entity definition XML element to disable this if not desired). The problem is with populating those fields. Right now the Entity Engine is UserLogin agnostic, or in other words it doesn't know anything about authenticated users. There has been some talk here and there about perhaps changing this, but it would be a pretty big change either in the API, or in semantics using a thread-local variable or something to keep track of the currently logged in user. Another reason this has been discussed is to do security permissions and such on the data layer rather than where we do it now (on the service layer for CrUD operations, and in the UI layer (the screen widget) for view operations). This introduces some rather numbing complexity into the system, but does allow for nice protection in some ways too. Right now there are no firm plans to implement these things. BTW, about the Entity Engine API, there are lots of cleanups I'd like to do to it, especially on the GenericDelegator. There are many find methods and such there that were used in ages past that are really no longer needed, and some patterns like have methods with "Cache" at the end for cached operations instead of passing in a "cache" boolean argument, and I'd like to clean those out. However, those would be significant non-backward compatible changes. Heck, if we get into those we might as well gut the things I don't like any more in the simple-methods too, quite a few not longer needed operations there that are just confusing... (like field-to-field, env-to-field, env-to- env, find-by-and, find-by-primary-key, various others; plus all of the field-name/map-name pairs that should be replaced with just plain env-name now that we have the string expansion and map accessor syntax stuff available). -David On Aug 11, 2005, at 3:48 AM, Yan Li wrote: > Hello, > > Under many circumstances I found the need for fields like > "createdByUserLogin" and "lastModifiedByUserLogin" on every entity > just like the auto time stamp. I wonder your opinion on this and why > these were not included in OFBiz Entity Engine yet? > > I've searched through the mailing list and found just one post on > this: > http://lists.ofbiz.org/pipermail/dev/2004-November/007083.html > > But no answer to it. > > Thanks in advance. > > -- > Best regards, > Yan > > _______________________________________________ > Dev mailing list > [hidden email] > http://lists.ofbiz.org/mailman/listinfo/dev > _______________________________________________ Dev mailing list [hidden email] http://lists.ofbiz.org/mailman/listinfo/dev |
Hello,
Thanks, David. Now I understood the difficulty of populate UserLogin infomation into entity layer. Previously I thought this could be implemented by Entity ECA or a simple patch on Entity Engine. So I'm considering to find a way to implement it by Service ECA. I didn't have much experience on the architect of such systems, so I didn't know whether it is a "right way" to populate UserLogin infomation into entity layer, and whether it deserves future efforts. What's your opinion? As to the cleanup of Entity Engine API, perhaps we can do such non-backward-compatible things in next major version? or in a standalone branch? At first, I thought we should mark up these methods and simple-method operations "obsolete" in the src and doc. On 8/11/05, David E. Jones <[hidden email]> wrote: > > It wouldn't be too hard to change the Entity Engine to automatically > add these 2 fields to every entity (just like with the time-stamps, > and have an attribute on the entity definition XML element to disable > this if not desired). > > The problem is with populating those fields. Right now the Entity > Engine is UserLogin agnostic, or in other words it doesn't know > anything about authenticated users. There has been some talk here and > there about perhaps changing this, but it would be a pretty big > change either in the API, or in semantics using a thread-local > variable or something to keep track of the currently logged in user. > > Another reason this has been discussed is to do security permissions > and such on the data layer rather than where we do it now (on the > service layer for CrUD operations, and in the UI layer (the screen > widget) for view operations). This introduces some rather numbing > complexity into the system, but does allow for nice protection in > some ways too. > > Right now there are no firm plans to implement these things. > > BTW, about the Entity Engine API, there are lots of cleanups I'd like > to do to it, especially on the GenericDelegator. There are many find > methods and such there that were used in ages past that are really no > longer needed, and some patterns like have methods with "Cache" at > the end for cached operations instead of passing in a "cache" boolean > argument, and I'd like to clean those out. However, those would be > significant non-backward compatible changes. Heck, if we get into > those we might as well gut the things I don't like any more in the > simple-methods too, quite a few not longer needed operations there > that are just confusing... (like field-to-field, env-to-field, env-to- > env, find-by-and, find-by-primary-key, various others; plus all of > the field-name/map-name pairs that should be replaced with just plain > env-name now that we have the string expansion and map accessor > syntax stuff available). > > -David > > > On Aug 11, 2005, at 3:48 AM, Yan Li wrote: > > > Hello, > > > > Under many circumstances I found the need for fields like > > "createdByUserLogin" and "lastModifiedByUserLogin" on every entity > > just like the auto time stamp. I wonder your opinion on this and why > > these were not included in OFBiz Entity Engine yet? > > > > I've searched through the mailing list and found just one post on > > this: > > http://lists.ofbiz.org/pipermail/dev/2004-November/007083.html > > > > But no answer to it. > > > > Thanks in advance. > > > > -- > > Best regards, > > Yan > > > > _______________________________________________ > > Dev mailing list > > [hidden email] > > http://lists.ofbiz.org/mailman/listinfo/dev > > > > > _______________________________________________ > Dev mailing list > [hidden email] > http://lists.ofbiz.org/mailman/listinfo/dev > -- Best regards, Yan _______________________________________________ Dev mailing list [hidden email] http://lists.ofbiz.org/mailman/listinfo/dev |
Free forum by Nabble | Edit this page |