Giter VIP home page Giter VIP logo

dissectingangulararchitecture's Introduction

Introduction

This repository has the objective of providing an overview of the architecture of the code generated by the GeneXus Angular generator.

Design Decisions

  • The generator allows the coexistence of generated code with manually written code.
  • The generator is using the latest Angular and Typescript versions.
  • Choose and mantain references to the best modules out there.
  • Cross platform Node Scripts.
  • Cross Framework Standard Classes to be shared between different Front-end generators (https://github.com/genexuslabs/web-standard-functions)
  • Cross Framework UI Controls te be shared between different Front-end generators (https://github.com/genexuslabs/web-controls-library)
  • 3 tier client generation (UI, Behavior, Data Connectors)

Architecture

Angular High Level Architecture

Current Power of the Generator

The Angular generator is a front-end generator. The generated objects run on the browser and communicate with the back-end on the server to get and send information.

The back-end is not generated by the Angular generator; instead, it is generated by one of the existing GeneXus generators, such as the Java, .Net or .NetCore generator.

Generated Source Code

Every GeneXus object is generated in a separate directory, where all the sources are grouped. This is under the \mobile\Angular<main>\src\apps folder.

Generated Code Structure

For each panel, a component (the fundamental building block of Angular applications) is generated, which consists of three sources:

  • *.component.html

is the layout of the panel. It is an Angular template that represents the layout of UI. It is mainly HTML 5 referencing webcomponents from the open source library of controls, and it adds elements and attributes that Angular interprets to perform the bindings with the data model and the specified UI events.

  • *.component.ts

is the particular logic of the panel. It is a TypeScript program. Events are generated here, and the state that is bound to the UI is manipulated here.

  • *.sercvice.ts : is the layer responsible for interacting with the server. It is a Typescript program where communication with the server is generated. Here, the structures are also generated with the data model that the panel will use.

Exploring a Sample

In order to see the kind of code GeneXus is generating in this repository you have the full source code of an application.

The application basically is a "Light" CRM with Contacts, Companies and Meetings.

LightCRM

The backend services are hosted in AWS and the Angular generated code you can download and explore locally or here directly on github.

You can run the Angular code locally just by cloning this repository and after:

cd LightCRMSample npm install ng serve -o

Understanding the code generated

Understanding the generated code is quite simple, for each panel in Genexus you will have at least 3 files generated as mentioned above. There are several cases where we are generating components for different parts of one panel, for example if you have a Tab then we are generating a component for each tab page. Or if you have a Work With and Entity with several sections we are generating 3 files for each section, always respecting the separation of concerns in terms of UI, behavior and data access.

For example take a look WorkWithDevicesCompany is composed of several sections:

  1. A master with a list of the Companies, so we have
  2. A detail for each company that is called when a Company is selected
  3. The Detail of a company has a General section and a Contacts section to show all the information of a company, so GeneXus generates the General section and the contacts section:

Extensibility Scenarios

Using GeneXus Extensibility constructions

Mixing Generated and Manually written code

You can add your hand written code with the GeneXus generated code, actually you can say in some moment that some given object in Genexus is not generated by GeneXus any more by using the NO Generate property in GeneXus.

By Changing the Angular Generator

You can modify the Generator according to your needs! Obviously you need to merge future generator updates, but you get control over the "machine" that creates software.

The Angular generator is a Template-Based generator built on traditional generation technologies such as ASTs and string templates.

Starting from a high level metadata, the generator applies succesive transforms to acheive a metadata tree generable with a templating engine.

dissectingangulararchitecture's People

Contributors

ag-silva avatar ggallotti avatar gmilano avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

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.