Home
Help
Register
Log in

Search

 
   Active Threads  

You are here: Home > LLBLGen Pro > LLBLGen Pro Runtime Framework> ReadOnly entities
 

Pages: 1
LLBLGen Pro Runtime Framework
ReadOnly entities
Page:1/1 

  Print all messages in this thread  
Poster Message
Mountain
User



Location:
Florida
Joined on:
01-Apr-2005 05:05:51
Posted:
21 posts
# Posted on: 01-Apr-2005 05:10:40.  
What is the best way to make an entity (including any child entities) entirely readonly? Once an entity is made readonly, how could it then be made readwrite again? Thanks!

P.S. I know about the IsReadOnly property for collections -- I just want to do something similar for a single entity.
  Top
Otis
LLBLGen Pro Team



Location:
The Hague, The Netherlands
Joined on:
17-Aug-2003 18:00:36
Posted:
38086 posts
# Posted on: 01-Apr-2005 10:01:14.  
I looked for a solution for this for a while, but the problem is: how to make it read-only without a switch property? I mean: Setting a property to show it's read-only, will not work of course, because setting it to false will make it readwrite again. A wrapper like the ArrayList readonly wrapper could be, but that would require new types I think.

I haven't found a way to solve this properly yet.


Frans Bouma
LLBLGen Pro / ORM Profiler Lead Developer | Blog | Twitter
 
Top
jeffreygg
User



Location:
Stockton, CA USA
Joined on:
26-Oct-2003 05:53:24
Posted:
805 posts
# Posted on: 01-Apr-2005 11:09:43.  
Otis wrote:
I looked for a solution for this for a while, but the problem is: how to make it read-only without a switch property? I mean: Setting a property to show it's read-only, will not work of course, because setting it to false will make it readwrite again. A wrapper like the ArrayList readonly wrapper could be, but that would require new types I think.

I haven't found a way to solve this properly yet.



Hmmm...how about Decorator? Create a read-only entity that wraps the read/write entity but only allows read access. This might prove problematic in terms of collections, relations, etc, but this could be a bullet-proof method of controlling access...admittedly on a chunky, entity-level basis.

Just re-reading your post...I think this is what you're referring to with the ArrayList readonly wrapper...

Jeff...
LLBLGen Pro Version: 2.6
Runtime Library Version: 2.6.8.1013
 
Top
Otis
LLBLGen Pro Team



Location:
The Hague, The Netherlands
Joined on:
17-Aug-2003 18:00:36
Posted:
38086 posts
# Posted on: 01-Apr-2005 11:47:34.  
Yes, the decorator pattern indeed Regular Smiley

It's not easily implemented I think. I could make an internal constructor which sets a readonly flag and accepts a fields object, setting flags on related objects as well, but it is cumbersome to propagate it through to all the fields and make sure there is no way to write a value into any field.


Frans Bouma
LLBLGen Pro / ORM Profiler Lead Developer | Blog | Twitter
 
Top
Pages: 1  


Powered by HnD ©2002-2007 Solutions Design
HnD uses LLBLGen Pro

Version: 2.1.12172008 Final.