Giter Site home page Giter Site logo

entity's Introduction

entity

External dependencies

  • black (pip install black)
  • prettier (npm install prettier -g)

Goals

  • From entity description, generate entity classes and entity managers. (Django, TypeScript)
    • Generate code via AST library?
  • Generate communication methods between frameworks. (REST)
  • Support for languages/frameworks must be extendible. (SQL, Java, JavaScript)
  • Support for communication methods must be extendible. (WebSockets)
  • Must support adding of custom methods. (Q: add them within the entity description versus manually within the generated code?)
  • Configurable: specify where code must be generated.
  • Command line support for updating entities.
  • Support for migrations. (only necessary for persistent frameworks like SQL?)
  • Support for authorization.

Example

Notes:

  • somehow keep track of Python dependencies and generate right imports?

  • mapping from entity field to concrete field: explicitely given, type map, default field for type

  • field configuration: max characters etc -> also work with defaults and fallbacks (same hierarchy as field-mapping)

  • provide default filename

  • how to specify whether entities should be in seperate files or not? (might also not always be possible! -> language dependent)

  • how to handle multiple generations for one entity? (e.g. JSONEvent, Event, InitialEvent, each with its own field-mapping??)

  • handle renaming of variables (default, specify yourself) -> camelCase, pascal_case, ... (use common casing scripts?)

  • language-specific options (e.g. Java: package)

  • support optional fields?

  • get example with relations!

Entity

Event name: String year: Integer description: String

Period name: String start: Integer end: Integer description: String

Generation config

Python filename = entities.py // Optional (define resulting) location = ./app/ // Mandatory type-map = [ // Optional // example: String -> TextField() ]

Python-Event // Optional description = TextField() // Optional: overwrite field

Python-Period // Optional description = TextField() // Optional: overwrite field

TypeScript location = ./frontend/src/app/api/

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.