{"id":20238559,"url":"https://github.com/badetitou/casino","last_synced_at":"2025-04-10T19:35:48.498Z","repository":{"id":38205325,"uuid":"110116984","full_name":"badetitou/Casino","owner":"badetitou","description":"Casino is a set of tool I'm developping to help developers migrate their applications","archived":false,"fork":false,"pushed_at":"2024-11-20T09:46:07.000Z","size":3098,"stargazers_count":8,"open_issues_count":6,"forks_count":3,"subscribers_count":5,"default_branch":"v3","last_synced_at":"2025-03-24T17:13:46.894Z","etag":null,"topics":["metamodel","migration","pharo","smalltalk"],"latest_commit_sha":null,"homepage":"https://badetitou.fr/projects/casino","language":"Smalltalk","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/badetitou.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2017-11-09T13:11:40.000Z","updated_at":"2024-11-20T09:45:58.000Z","dependencies_parsed_at":"2023-10-12T21:46:30.842Z","dependency_job_id":"f134e660-c513-4a4d-9102-325f415b4942","html_url":"https://github.com/badetitou/Casino","commit_stats":null,"previous_names":[],"tags_count":43,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/badetitou%2FCasino","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/badetitou%2FCasino/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/badetitou%2FCasino/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/badetitou%2FCasino/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/badetitou","download_url":"https://codeload.github.com/badetitou/Casino/tar.gz/refs/heads/v3","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248281417,"owners_count":21077423,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["metamodel","migration","pharo","smalltalk"],"created_at":"2024-11-14T08:34:45.616Z","updated_at":"2025-04-10T19:35:48.490Z","avatar_url":"https://github.com/badetitou.png","language":"Smalltalk","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Casino \u003c!-- omit in toc --\u003e\n[![CI Moose 11 (buggy from Pharo)](https://github.com/badetitou/Casino/actions/workflows/blank.yml/badge.svg?branch=v3)](https://github.com/badetitou/Casino/actions/workflows/blank.yml)\n[![Coverage Status](https://coveralls.io/repos/github/badetitou/Casino/badge.svg?branch=v2)](https://coveralls.io/github/badetitou/Casino?branch=v2)\n[![Moose version 11](https://img.shields.io/badge/Moose-11-%23aac9ff.svg)](https://github.com/moosetechnology/Moose)\n\nThis project aims to ease the migration of application front-end using metamodels.\nTo do so, it extracts the UI model of an application and generates the target application from the model.\n\nThis repository includes the whole work needed to migrate a GWT application to an Angular one.\nOther importers and exporters are [available](https://github.com/badetitou?tab=repositories\u0026q=Casino\u0026type=\u0026language=).\n\n- [Package description](#package-description)\n- [Installation](#installation)\n- [Repository architecture](#repository-architecture)\n- [Example of Casino usage](#example-of-casino-usage)\n  - [Extraction](#extraction)\n    - [For GWT application](#for-gwt-application)\n    - [Existing JSON file](#existing-json-file)\n    - [Other existing importers](#other-existing-importers)\n  - [Generate](#generate)\n    - [Angular application](#angular-application)\n    - [Other generators](#other-generators)\n- [Developers](#developers)\n- [Links](#links)\n  - [Other documentation (might be outdated):](#other-documentation-might-be-outdated)\n  - [Linked research papers](#linked-research-papers)\n- [Contacts](#contacts)\n\n\u003e This project is a research project part of an industrial project at [Berger-Levrault](http://berger-levrault.com/) in collaboration with the [RMoD Team - Inria](https://rmod.inria.fr/web)\n\n## Package description\n\nThis repository contains the main packages of Casino.\nIt includes:\n\n- A metamodel to represent the front-end of an application\n- An Importer for this metamodel\n- An Exporter for this metamodel\n- A Specific Importer for Java (GWT)\n- A Specific Exporter to Angular\n\nIt also contains some specific package for a company (but you don't need to know)\n\n## Installation\n\nTo install Casino:\n\n1. Download the last [Moose Image](https://moosetechnology.github.io/moose-wiki/)\n2. In the Moose Image execute\n\n```Smalltalk\nMetacello new\n  githubUser: 'badetitou' project: 'Casino' commitish: 'v2.0.29' path: 'src';\n  baseline: 'Casino';\n  onConflictUseIncoming;\n  load: #('core' 'behavior')\n```\n\nThis should load the version *v2.0.24* of the project (you can also specify another version or branch).\n\n## Repository architecture\n\nHere I'll try to explain you the repository architecture of Casino.\n\nThere are three main parts:\n\n- Casino-Model-*X* is about the visual part of the model\n- Casino-Business-*X* is about the data manipulated by the application\n- Casino-Behavior-*X* is about the behavior of the UI (*e.g.* what happen when someone clicks on this button)\n\n## Example of Casino usage\n\n### Extraction\n\n#### For GWT application\n\n1. Load a Moose model\n\n```Smalltalk\n'path/to/model.json' asFileReference readStreamDo: [ :stream | famixModel := FamixJavaModel new importFromJSONStream: stream ]\n```\n\n\u003e You can create a JSON model using [VerveineJ](https://modularmoose.org/moose-wiki/Developers/Parsers/VerveineJ)\n\u003e With the command: `\u0026 'D:\\Developpement\\mse\\VerveineJ\\verveinej.bat' -o test.json -format json -anchor assoc -autocp .\\lib\\ .\\src`\n\n2. Create a Casino model\n\n```Smalltalk\n\"create a metamodel with Casino UI, Behavioral, Business, and FAMIX ref\"\nmetamodel := FMMetaModelBuilder metamodelFromPackages: CSNBModel packagesToProcessToCreateMetamodel , CRFModel packagesToProcessToCreateMetamodel, CSNBuModel packagesToProcessToCreateMetamodel.\n\"Create a model\"\ngwtModel := CSNUICWModel new name: 'Omaje'; yourself.\n\"fix the metamodel of the model\"\ngwtModel metamodel: metamodel.\n```\n\n3. Extract the UI with an [extractor]((https://github.com/badetitou?tab=repositories\u0026q=Casino\u0026type=\u0026language=)).\n\n\n\n```Smalltalk\nxml := (XMLDOMParser parse: 'path/to/myApp.module.xml' asFileReference).\n\nCSNWebModelJava new\n  sourceModel: famixModel;\n  xml: xml;\n  createModelIn: gwtModel.\n```\n\n4. Extract the behavior of the UI\n\n```Smalltalk\nbehavioralModel := CSNBehaviorModelImporterJava new \n  uiModel: gwtModel;\n  sourceCodeModel: famixModel;\n  resetUIAndGenerateBehavioralModel.\n```\n\n5. Extract the business concept (DTO) from services usage\n\n```Smalltalk\nbusinessImporter := CSNBuModelImporter new.\nbusinessImporter buModel: gwtModel.\nbusinessImporter famixModel: famixModel.\ngwtModel allCSNServiceAPI do: [ :serviceAPI |  \n\tbusinessImporter importForServiceApi: serviceAPI.\n].\n```\n\n#### Existing JSON file\n\n```SmallTalk\n\"create a metamodel with Casino UI, Behavioral, Business, and FAMIX ref\"\nmetamodel := FMMetaModelBuilder metamodelFromPackages: CSNBModel packagesToProcessToCreateMetamodel , CRFModel packagesToProcessToCreateMetamodel, CSNBuModel packagesToProcessToCreateMetamodel.\n\n\"Create a model\"\ncasinoModel := CSNUICWModel new name: 'MyModel'; yourself.\n\n\"fix the metamodel of the model\"\ncasinoModel metamodel: metamodel.\n\n'/path/to/model.json' readStreamDo: [:stream | casinoModel importFromJSONStream: stream ].\n```\n\n#### Other existing importers\n\n[In GitHub](https://github.com/search?q=Casino-+-Importer)\n\n### Generate\n\n#### Angular application\n\n6. Export the UI and its behavior\n\n```Smalltalk\n\"Create an exporter\"\nexporter := CSNModelExporterAngularBLSpecific new.\nexporter model: gwtModel.\n\n\"Set the home page\"\nexporter homePage: (evolModel detect: [:page | page name = 'MyHomePage']).\n\n\"Use the material.angular.io as target library\"\nexporter exporterAngularConfiguration: CSNExporterAngularMaterialConfiguration new.\nexporter attributeExporter: CSNExporterAngularAttribute new.\nexporter prepareExport.\n\n\"Select export location\"\nexporter context root: '/path/for/export' asFileReference.\nexporter runExport.\n\"\n```\n\n7. Export the data models (DTO)\n\n```Smalltalk\nroot := (exporter context root / 'models') asFileReference ensureCreateDirectory.\nbusinessExporter := CSNBusinessExporter new modelRoot: root.\nbusinessExporter export: gwtModel.\n```\n\n#### Other generators\n\n[In GitHub](https://github.com/search?q=Casino-+-Exporter)\n\n## Developers\n\nIf you want to implement your importer, you should look at the `CSNWebModel` class.\nThis is the abstract importer of Casino.\n\nHere, we will only give hints on the main Casino project, with the GWT importer and Angular Exporter.\n\n- [Add/Customize Angular target widget](./doc/customize-angular-target.md)\n\n## Links\n\n### Other documentation (might be outdated):\n\n- [Personal website page](https://badetitou.github.io/projects/Casino/)\n\n### Linked research papers\n\nIn no specific order:\n\n- [GUI Migration using MDE from GWT to Angular 6: An Industrial Case](https://ieeexplore.ieee.org/document/8667989)\n- [Challenges for Layout Validation: Lessons Learned](https://hal.inria.fr/hal-02914750/document)\n- [Switching of GUI framework: the case from Spec to Spec 2](https://hal.archives-ouvertes.fr/hal-02297858/file/iwst19.pdf)\n- [Migrating GWT to Angular 6 using MDE](https://hal.inria.fr/hal-02304301/file/sattose2019.pdf)\n\n## Contacts\n\nPlease, for any question [contact me by mail](mailto:badetitou@gmail.com).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbadetitou%2Fcasino","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fbadetitou%2Fcasino","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbadetitou%2Fcasino/lists"}