Application data management

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
8 messages Options
Reply | Threaded
Open this post in threaded view
|

Application data management

Felix Dorner
Hi,

I am thinking of how application data is best persisted in squeak apps.
Probably I have problems in distinguishing the Squeak "platform" and  my
Application.

If I see my application as a part of squeak, then I guess there's no
need for custom resource management - as soon as a user does "save.."
all is saved automatically, including my app data (here its just a list
of filenames).

Is that the intended way? Or is "Save..." intended for developing only?
Gee squeak is really different.

Otherwise, I could do it all manually, persist my data to
somehomedir/.myappdata

How can I get the current user home?


Thanks for your comments.

Felix
_______________________________________________
Beginners mailing list
[hidden email]
http://lists.squeakfoundation.org/mailman/listinfo/beginners
Reply | Threaded
Open this post in threaded view
|

Re: Application data management

cedreek
Hi,

> Hi,
>
> I am thinking of how application data is best persisted in squeak apps.
> Probably I have problems in distinguishing the Squeak "platform" and  my
> Application.
>
> If I see my application as a part of squeak, then I guess there's no need
> for custom resource management - as soon as a user does "save.." all is
> saved automatically, including my app data (here its just a list of
> filenames).
filenames ?

The squeal image is a kind of cache. It can be used to save but it
shouldn't as not always reliable, threadsafe, etc...
There's plenty of option for persistence. One I tried recently is
Sandstone (in squeaksource), it's an active record like persistence
solution that save objects into files.

But there are plenty of persistence solution. Depends on your need.
>
> Is that the intended way? Or is "Save..." intended for developing only? Gee
> squeak is really different.
>
> Otherwise, I could do it all manually, persist my data to
> somehomedir/.myappdata

What kind of data ? records, objects...


>
> How can I get the current user home?

home directory ?  FileDirectory default


Cheers,

Cédrick

>
>
> Thanks for your comments.
>
> Felix
> _______________________________________________
> Beginners mailing list
> [hidden email]
> http://lists.squeakfoundation.org/mailman/listinfo/beginners
>

_______________________________________________
Beginners mailing list
[hidden email]
http://lists.squeakfoundation.org/mailman/listinfo/beginners
Reply | Threaded
Open this post in threaded view
|

Re: Application data management

Michael van der Gulik-2
In reply to this post by Felix Dorner
On Thu, 10 Jul 2008 09:59:06 +0200
Felix Dorner <[hidden email]> wrote:

> Hi,
>
> I am thinking of how application data is best persisted in squeak apps.
> Probably I have problems in distinguishing the Squeak "platform" and  my
> Application.
>
> If I see my application as a part of squeak, then I guess there's no
> need for custom resource management - as soon as a user does "save.."
> all is saved automatically, including my app data (here its just a list
> of filenames).
>
> Is that the intended way? Or is "Save..." intended for developing only?
> Gee squeak is really different.

Well... that's referred to as "Image based persistence" :-). And yes, it is one way of persisting user's data. Some people here store lots of information in their images - presentations, stuff they type up, small prototype apps, etc. It's certainly not just for developers.

> Otherwise, I could do it all manually, persist my data to
> somehomedir/.myappdata

If you want to get serious, there are other options for persisting image data. Google for Magma and GOODS.

> How can I get the current user home?

Er... that's a hard one. I actually don't know. I'd probably start by installing the OSProcess package which might have something like that. I've had a quick look in my image and can't find anything.

Anybody else know?

Gulik.

--
Michael van der Gulik <[hidden email]>
_______________________________________________
Beginners mailing list
[hidden email]
http://lists.squeakfoundation.org/mailman/listinfo/beginners
Reply | Threaded
Open this post in threaded view
|

Re: Application data management

Felix Dorner
In reply to this post by cedreek
Hi Cedric,
>> here its just a list of
>> filenames).
>>    
>
> filenames ?
>  
Hehe, Strings I should say...
> The squeal image is a kind of cache. It can be used to save but it
> shouldn't as not always reliable, threadsafe, etc...
> There's plenty of option for persistence. One I tried recently is
> Sandstone (in squeaksource), it's an active record like persistence
> solution that save objects into files.
>  

> What kind of data ? records, objects...
>
>  
What do you mean by a record? As I am currently just exploring the
Squeak world, i have no need for interchange, Objects would be fine if
that is the easiest.
> home directory ?  FileDirectory default
>  
Ok, thanks.
Felix

_______________________________________________
Beginners mailing list
[hidden email]
http://lists.squeakfoundation.org/mailman/listinfo/beginners
Reply | Threaded
Open this post in threaded view
|

Re: Application data management

Jens Mönig
In reply to this post by Felix Dorner
In a deployed app I like to lock up the image and use class ReferenceStream (which is, for once, nicely documented) to write/read app data, or any of the availabe XML packages, if the app data is intended to be also processed by other non-Squeak apps.


Felix Dorner wrote
Hi,

I am thinking of how application data is best persisted in squeak apps.
Probably I have problems in distinguishing the Squeak "platform" and  my
Application.

If I see my application as a part of squeak, then I guess there's no
need for custom resource management - as soon as a user does "save.."
all is saved automatically, including my app data (here its just a list
of filenames).

Is that the intended way? Or is "Save..." intended for developing only?
Gee squeak is really different.

Otherwise, I could do it all manually, persist my data to
somehomedir/.myappdata

How can I get the current user home?


Thanks for your comments.

Felix
_______________________________________________
Beginners mailing list
Beginners@lists.squeakfoundation.org
http://lists.squeakfoundation.org/mailman/listinfo/beginners
Reply | Threaded
Open this post in threaded view
|

Re: Application data management

cedreek
In reply to this post by Felix Dorner
>>>
>>> here its just a list of
>>> filenames).
>>>
>>
>> filenames ?
>>
>
> Hehe, Strings I should say...
>>

Can you give one or two examples. Strings are not usual. I mean, it's
better not to store objects as string ;) Unless you need to read your
persistence backups, it's better to store with stuff like
ImageSegment, SmartRefStream (look at the in your image - class
comment)... But you've tools for that.

These posts could help: http://onsmalltalk.com/category/databases/

>> The squeal image is a kind of cache. It can be used to save but it
>> shouldn't as not always reliable, threadsafe, etc...
>> There's plenty of option for persistence. One I tried recently is
>> Sandstone (in squeaksource), it's an active record like persistence
>> solution that save objects into files.
>>
>
>> What kind of data ? records, objects...
>>
>>
>
> What do you mean by a record?
Table record, relation   -> Relational database maybe

If objects, before using a proper OODB, have a look at that:
http://www.squeaksource.com/SandstoneDb

Cheers,

Cédrick


>As I am currently just exploring the Squeak
> world, i have no need for interchange, Objects would be fine if that is the
> easiest.
>>
>> home directory ?  FileDirectory default
>>
>
> Ok, thanks.
> Felix
>
> _______________________________________________
> Beginners mailing list
> [hidden email]
> http://lists.squeakfoundation.org/mailman/listinfo/beginners
>

_______________________________________________
Beginners mailing list
[hidden email]
http://lists.squeakfoundation.org/mailman/listinfo/beginners
Reply | Threaded
Open this post in threaded view
|

Re: Application data management

Bert Freudenberg
In reply to this post by Felix Dorner

Am 10.07.2008 um 09:59 schrieb Felix Dorner:

> Hi,
>
> I am thinking of how application data is best persisted in squeak  
> apps. Probably I have problems in distinguishing the Squeak  
> "platform" and  my Application.
>
> If I see my application as a part of squeak, then I guess there's no  
> need for custom resource management - as soon as a user does  
> "save.." all is saved automatically, including my app data (here its  
> just a list of filenames).
>
> Is that the intended way? Or is "Save..." intended for developing  
> only? Gee squeak is really different.

Typically a user would not save the image of an app. This is a dev-
time feature only.

> Otherwise, I could do it all manually, persist my data to  
> somehomedir/.myappdata
>
> How can I get the current user home?


There is no way in regular Squeak. You can use FFI or pass it from the  
script running your app.

The shining example for this is Sophie:

        http://www.sophieproject.org/

They have a Files-Locations package using FFI to find out about system-
specific directories for app data, documents, images, desktop etc.

- Bert -


_______________________________________________
Beginners mailing list
[hidden email]
http://lists.squeakfoundation.org/mailman/listinfo/beginners
Reply | Threaded
Open this post in threaded view
|

Re: Application data management

K. K. Subramaniam
In reply to this post by cedreek
On Thursday 10 Jul 2008 2:21:18 pm cdrick wrote:
> > How can I get the current user home?
>
> home directory ?  FileDirectory default
There are multiple directory paths involved in Squeak;

1. Path where VM binary is located:
 SmalltalkImage current vmPath  "directory containing VM executable"

2. Path containing image file
        SmalltalkImage current imagePath "directory containing image"
        SmalltalkImage current imageName "full path of image file"

If you are running projects within a browser, the imageName is
$HOME/.npsqueak/SqueakPlugin.image"

3. Current working directory ("home" directory) is $SQUEAK_USERDIR.
       FileDirectory default
   If $SQUEAK_USERDIR is not set, this defaults to "My Squeak/" sub-directory
of the image directory. But if
    Preferences startInUntrustedDirectory
     is false, then it is set to the image path, a trusted directory.

4. Security keys are generated in the directory $SQUEAK_SECUREDIR or
in "secure/" sub-directory under the image directory.
      SecurityManager default

5. Lastly, loaded Projects are cached in  "Squeaklets/" sub-directory in
current working directory (even if the project files come from a local
path :-():
        Project squeakletDirectory

Hope this helps,
Subbu
_______________________________________________
Beginners mailing list
[hidden email]
http://lists.squeakfoundation.org/mailman/listinfo/beginners