Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/opensmock/bloc-serialization
Bloc serialization features to store/unstore BlElements.
https://github.com/opensmock/bloc-serialization
bloc graphics graphics-library hmi ihm open-smock pharo pharo-smalltalk serialization serialization-library serialize serializer smalltalk smock ston ui ux
Last synced: 2 months ago
JSON representation
Bloc serialization features to store/unstore BlElements.
- Host: GitHub
- URL: https://github.com/opensmock/bloc-serialization
- Owner: OpenSmock
- License: mit
- Created: 2023-01-23T09:54:05.000Z (almost 2 years ago)
- Default Branch: main
- Last Pushed: 2024-10-01T15:10:45.000Z (3 months ago)
- Last Synced: 2024-10-09T13:20:12.006Z (2 months ago)
- Topics: bloc, graphics, graphics-library, hmi, ihm, open-smock, pharo, pharo-smalltalk, serialization, serialization-library, serialize, serializer, smalltalk, smock, ston, ui, ux
- Language: Smalltalk
- Homepage:
- Size: 140 KB
- Stars: 1
- Watchers: 1
- Forks: 1
- Open Issues: 2
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
[![License](https://img.shields.io/github/license/openSmock/Bloc-Serialization.svg)](./LICENSE)
[![Pharo 11 CI](https://github.com/OpenSmock/Bloc-Serialization/actions/workflows/Pharo11CI.yml/badge.svg)](https://github.com/OpenSmock/Bloc-Serialization/actions/workflows/Pharo11CI.yml)
[![Pharo 12 CI](https://github.com/OpenSmock/Bloc-Serialization/actions/workflows/Pharo12CI.yml/badge.svg)](https://github.com/OpenSmock/Bloc-Serialization/actions/workflows/Pharo12CI.yml)# Bloc-Serialization
Bloc serialization features to store/unstore BlElements.
## Getting Started
### Installation
To install Bloc-Serialization on your Pharo image you can just execute the following script:
```smalltalk
Metacello new
baseline: 'BlocSerialization';
repository: 'github://OpenSmock/Bloc-Serialization:main/src';
load.
```## How to use
### Serialization
Use this method to serialize any BlElement into a String.
```smalltalk
blElement := BlElement new.string := blElement serialize.
```Use same method to serialize a list of BlElement into a String.
```smalltalk
oc := OrderedCollection new.
oc add: BlElement new.
oc add: BlElement new.
oc add: BlElement new.string := oc serialize.
```### Materialization (Deserialization)
Use this method to materialize any serialized String into a BlElement.
Of course, you need to know that the string is a serialized BlElement.```smalltalk
blElement := string materializeAsBlElement.
```Use this method to materialize any serialized String into a BlElement collection.
Of course, you need to know that the string is a serialized Collection.```smalltalk
oc := string materializeAsBlElement.
```Tips : you can quickly copy a `BlElement` using `BlElement>>serializeThenMaterialize`.
```smalltalk
element := BlElement new.
copy := element serializeThenMaterialize.
```### Exception / Error
Serialization or Materialization process return some exceptions in case of problems :
- `BlocSerializerError`
> `BlocSerializationError`
> `BlocMaterializationError`## Serialization backends
Actually `STON` is the only backend used for serialization. The project architecture allow to add anothers serialization backends if needed.
## Dependencies
- [Bloc](https://github.com/pharo-graphics/Bloc)
- [STON](https://github.com/svenvc/ston)## License
This project is licensed under the MIT License - see the [LICENSE](LICENSE) file for details.