Serializing classes with Fuel

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

Serializing classes with Fuel

khinsen
Hi everyone,

does anyone here have some experience with Fuel?

Its Web site says "It can serialize/materialize not only plain objects
but also classes, traits, methods, closures, contexts, packages,
etc.". So I should be able to serialize a class somehow, right?

But classes are by default treated as global objects, even if they
aren't. The class I want to serialize is created by
newAnonymousSubclass. And yet, Fuel only stores its name in the output
file.

The documentation describes considerGlobal: which does the opposite of
what I want. So my question is: how can I tell Fuel *not* to consider a
class as global?

Konrad.

Reply | Threaded
Open this post in threaded view
|

Re: Serializing classes with Fuel

Mariano Martinez Peck


On Tue, Mar 5, 2019 at 1:42 PM Konrad Hinsen <[hidden email]> wrote:
Hi everyone,

does anyone here have some experience with Fuel?

Its Web site says "It can serialize/materialize not only plain objects
but also classes, traits, methods, closures, contexts, packages,
etc.". So I should be able to serialize a class somehow, right?

But classes are by default treated as global objects, even if they
aren't. The class I want to serialize is created by
newAnonymousSubclass. And yet, Fuel only stores its name in the output
file.

The documentation describes considerGlobal: which does the opposite of
what I want. So my question is: how can I tell Fuel *not* to consider a
class as global?

Konrad.


Yes, that's the "default" behavior. To fully serialize classes you need FuelMetalevel packages. This brings a new visitors and mappers to allow you to fully serialize methods, classes, contexts, etc. 
I am sorry but I couldn't remember where the docs about that were. You may want to at least take a look to the packages and their tests. 

Best, 


--
Reply | Threaded
Open this post in threaded view
|

Re: [Pharo-fuel] Serializing classes with Fuel

Max Leske
On 5 Mar 2019, at 19:22, Mariano Martinez Peck wrote:

> On Tue, Mar 5, 2019 at 1:42 PM Konrad Hinsen
> <[hidden email]>
> wrote:
>
>> Hi everyone,
>>
>> does anyone here have some experience with Fuel?
>>
>> Its Web site says "It can serialize/materialize not only plain
>> objects
>> but also classes, traits, methods, closures, contexts, packages,
>> etc.". So I should be able to serialize a class somehow, right?
>>
>> But classes are by default treated as global objects, even if they
>> aren't. The class I want to serialize is created by
>> newAnonymousSubclass. And yet, Fuel only stores its name in the
>> output
>> file.
>>
>> The documentation describes considerGlobal: which does the opposite
>> of
>> what I want. So my question is: how can I tell Fuel *not* to consider
>> a
>> class as global?
>>
>> Konrad.
>>
>>
> Yes, that's the "default" behavior. To fully serialize classes you
> need
> FuelMetalevel packages. This brings a new visitors and mappers to
> allow you
> to fully serialize methods, classes, contexts, etc.
> I am sorry but I couldn't remember where the docs about that were. You
> may
> want to at least take a look to the packages and their tests.

I'm afraid we don't really have documentation for meta level. The tests
are the best place to look for guidance. But if you have concrete
questions, best send them to the fule list.

Max

>
> Best,
>
>
> --
> Mariano
> https://twitter.com/MartinezPeck
> http://marianopeck.wordpress.com


> _______________________________________________
> Pharo-fuel mailing list
> [hidden email]
> https://lists.gforge.inria.fr/mailman/listinfo/pharo-fuel

Reply | Threaded
Open this post in threaded view
|

Re: Serializing classes with Fuel

khinsen
In reply to this post by Mariano Martinez Peck
Hi Mariano,

> Yes, that's the "default" behavior. To fully serialize classes you need
> FuelMetalevel packages. This brings a new visitors and mappers to allow you
> to fully serialize methods, classes, contexts, etc.

Thanks for the pointer - I will explore FuelMetalevel.

Konrad.