Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/moosetechnology/famix-value
Famix metamodel for runtime values
https://github.com/moosetechnology/famix-value
meta-model moose pharo runtime smalltalk
Last synced: 7 days ago
JSON representation
Famix metamodel for runtime values
- Host: GitHub
- URL: https://github.com/moosetechnology/famix-value
- Owner: moosetechnology
- License: mit
- Created: 2023-03-06T14:31:37.000Z (almost 2 years ago)
- Default Branch: main
- Last Pushed: 2024-10-28T15:20:33.000Z (about 2 months ago)
- Last Synced: 2024-10-29T20:20:16.076Z (about 2 months ago)
- Topics: meta-model, moose, pharo, runtime, smalltalk
- Language: Smalltalk
- Homepage:
- Size: 384 KB
- Stars: 2
- Watchers: 13
- Forks: 1
- Open Issues: 2
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
[![Moose version](https://img.shields.io/badge/Moose-10-%23aac9ff.svg)](https://modularmoose.org/)
[![Moose version](https://img.shields.io/badge/Moose-11-%23aac9ff.svg)](https://github.com/moosetechnology/Moose)
![Build Info](https://github.com/moosetechnology/Famix-Value/workflows/CI/badge.svg)
[![Coverage Status](https://coveralls.io/repos/github/moosetechnology/Famix-Value/badge.svg?branch=main)](https://coveralls.io/github/moosetechnology/Famix-Value?branch=main)# Famix-Value
Famix-Value is a metamodel for representing runtime values and their corresponding types and entities in a [Famix](https://github.com/moosetechnology/Famix) model.
The goal is to simplify working with values from languages other than Smalltalk by reifying them and linking them to the Famix model of the application that produced them.
This project allows the values to be exported into code so that they can be recreated in their original programming language.Note that this is a work in progress: there are plans to improve the readability of the code, for example by giving variables better names.
## Installation
```st
Metacello new
githubUser: 'moosetechnology' project: 'Famix-Value' commitish: 'main' path: 'src';
baseline: 'FamixValue';
load
```## Example
Given the following Java class:
```java
public class MyClass {
int foo;
List bar;void setFoo(int foo) { this.foo = foo; }
void setBar(List bar) { this.bar = bar; }
}
```And the JSON serialization of an instance, produced by the [Jackson](https://github.com/FasterXML/jackson) library:
```json
{
"@type": "MyClass",
"foo": 42,
"bar": ["java.util.ArrayList", ["Hello", "World"]]
}
```Exporting this value produces the following code:
```java
MyClass myClass0 = new MyClass();
myClass.setFoo(42);
List bar1 = new ArrayList<>();
bar1.add("Hello");
bar1.add("World");
myClass0.setBar(bar1);
```