Re: Re: Re: propoal: persistence though id

[email protected]
Newsgroups gmane.comp.lang.prothon.user
Message-ID <[email protected]>
>>
>> i think its the maintenance of the duplication, rather than the
>> persistence, which causes the need for the Prosist Modes, the Modes
>> representing an unnecessary distinction between memory and file
>> objects. maintained duplication, as distinct from multiple
>> referencing, might be another core principle worthy of its own
>> separate methodology, after all its seems to me to be technically the
>> same thing as synchronisation.
>>

>> i think a simple and fairly obviously syntax for this would be to
>> extend the object function:
>>
>> reference= Object(objectReference)
>>
>> without objectReference, obviously the normal behaviour of creating a
>> new object with just Object as a prototype would occur, if
>> objectReference were a file name, then reference would become a file
>> object and the object id would be the file name.

>Creating a new type that was based on a file and was automatically
>persistant is an interesting concept.  It sort of turns Prosist on its head.
>i lilke this idea.  It could reuse much of Prosist's code.

actually, its more like a reference is being made to an object stored on a disk rather than in memory, the refrerence needs to be more general because the object is not under the interpreters complete control.

>I think it would co-exist with Prosist.  There are times when you would want
>to take an object tree created by some other code and use Prosist
>after-the-fact to store the tree, and in other applications you would want
>to start with your persistant file-based object and go from there.

>What would you call this type?  It is file-based.  You would want it to be a
>container or it would be useless.  Would you make it a dictionary?  Why not?
>Maybe make two versions, a list and a dict.  Call them FileList and
>FileDict?

whats this about types?  
the filed object would 'be' the type of the object it is, you see what i'm saying is the memory object shouldn't exist.
it may be implemented using a file object, and may actually exist in memory, and would behave exactly the same as other objects, only it would still be able to be referenced from one session to the next, and also by multiple tasks at the same time.

>Wait a minute.  What is the difference between this and opening a Prosist
>database with a root of a list or a dict?  Is there really any difference?
>You could argure that a FileList doesn't have to do the commit operation or
>a flush, but that is a disadvantage.  The only way to avoid a commit or a
>flush is to do one on every modification and that is a performance problem.

Yes, the filed object would have to update just as the memory object, so lots of nasty random access and resizing, except you would use a filed object in cases where this wasn't a problem, i'm thinking of there use on small objects and many of them, and you could also transparently do your own cache/buffer for larger objects, which i'm thinking is good late optimisation.  object locking and the archive bit would come in handy for this.

>There is a reason that files have flushes and commits.

>I think that what you are asking for is a pipe dream.  You'd like for the
>differences between objects and files to disappear but the differences are
>very real and can't go away by wishing them away.  Correct me if I'm wrong.

if you were to write to a file, commit it/close it, reopen it, read it, close and delete it, need it ever of left the RAM cache?

is it just possible for virtual memory to be written to disk and restored between each update of an object?

i think the differences are performance related and also historical, the benefits are huge, even more so for the removal of the class/instance split, see my other post about classes, which was badly delayed for some reason.

have you come across the idea of replacing a filing system with a database, it seemed brilliant to me when i first came across it, and if you think of a filing system in these terms the differences get a bit blurred, don't they?  especially when you think that databases already commonly are used to hold objects.


__________________________________________________________________
Switch to the New Netscape Internet Service.
As low as $9.95 a month -- Sign up today at http://isp.netscape.com/register

Netscape. Just the Net You Need. 

New! Netscape Toolbar for Internet Explorer
Search from anywhere on the Web and block those annoying pop-ups.
Download now at http://channels.netscape.com/ns/search/install.jsp
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.