I am writing a simple "quote-of-the-day" object for pharo that stores both quotes and pictures. What is the "idiomatic" way of storing data in pharo? Do I connect to some sort mysql database or is there a better "smalltalk" way to do it?
Re: What is the idiomatic way to store data in pharo?
Some ways I would do it, given what you have described:
1.Store in the image itself. An ordered collection can be used to store the your MOTD objects and iterate over them with the #do:, #select:, etc methods.
For images I would store them on the file system and use a URI from your objects to point to it.
3.If you wish to distribute this then maybe a central server the your client can pull the MOTD objects from. Something running Teapot talking to SQLite3
or even Postgres via Sven’s excellent P3 (https://github.com/svenvc/P3).
From: Pharo-users [mailto:[hidden email]]
On Behalf Of Steve Quezadas Sent: Tuesday, 28 January 2020 11:36 AM To: Any question about pharo is welcome <[hidden email]> Subject: Re: [Pharo-users] What is the idiomatic way to store data in pharo?
EXTERNAL: Do not click links or open attachments if you do not recognize the sender.
You could try with NeoJSON and serialize the image as bytecodes (or
urls to pictures in the web). Is pretty simple and gives you a plain and
portable representation of your Quote of the Day data. Grafoscopio, the
prototype I made, uses NeoJSON to store its notebooks. It's also a
pretty well written library that has Sven's quality mark and you can
learn a lot from it.
On 27/01/20 8:15 p. m., Steve Quezadas wrote:
> I am writing a simple "quote-of-the-day" object for pharo that stores
> both quotes and pictures. What is the "idiomatic" way of storing data
> in pharo? Do I connect to some sort mysql database or is there a
> better "smalltalk" way to do it?
> Forgive the naive question.
> - Steve