Coder Social home page Coder Social logo

nicolauatala / smartviper Goto Github PK

View Code? Open in Web Editor NEW

This project forked from nkopilovskii/smartviper

0.0 1.0 0.0 1.07 MB

Template and script are designed to generate a module on the MVC, MVP or VIPER architecture.

License: MIT License

Swift 91.09% Shell 8.91%

smartviper's Introduction

Swift License Platform

NKSmartViper Code Generator

The presented template and script are designed to generate a module on most popular architectures: MVC, MVP & VIPER.

The main idea of this solution is the possibility of using modules with different architectures, while not violating the principles of encapsulation and extensibility, to allow the developer to change the structure of individual modules without affecting the functionality of all the others.

The purpose of this solution:

  • speed up the process of writing code by autogenerating the module's templates;
  • create a single mechanism of communication between modules;
  • ensure compliance with SOLID principles.

Architectures & Components

The solution suggests the use of the following module architectures:

  • Model-View-Controller;
  • Model-View-Presenter;
  • VIPER.

Solution offers the use of global entities and services (as elements of Service Oriented Architecture).

This solution is based on the use of generics in order to reduce the preservation of the integral structure of the modules and avoid the redundant code in them.

Configurator is an abstract factory (creates objects of module levels and establishes dependencies between them) and the entry point to the module.

View displays UI. View appeals to the Presenter through the Presentation protocol.

Presenter organizes communication between all levels of the module.

  • Presenter appeals to View through the Viewable protocol.
  • Presenter appeals to Interactor through the UseCase protocol.
  • Presenter appeals to Router through the Wireframe protocol.

Interactor implements the business logic of the module, interacts with services (DB, Network, etc.). Interactor appeals to Presenter through the InteractorOutput protocol.

Router implements the transition from this module to another module.

How to use

  1. Copy NKSmartVIPER folder to your project.

  2. Run NKSmartViperCodeGen.

Important! Make sure the "Module" folder with the template files is in the same folder.

  1. Enter the target path for the created module.

  2. Select module architecture.

  3. Enter name of the created module.

  4. After successful generation of the module files at the specified path, add them to the project.

Example

Dowload folder with example project to get acquainted with the principles of module initialization.

Version history

v.1.0

v.2.0

  • Added MVC & MVP architecture templates and configurations
  • Developed a general mechanism for modules' configuring
  • Localizer removed and presented to individual module

v.2.1

  • Fixed issue

v.2.1.1

  • Updated comments in templates

Author

nkopilovskii, [email protected]

License

NKLocalizerTemplate is available under the MIT license. See the LICENSE file for more info.

smartviper's People

Contributors

nkopilovskii avatar

Watchers

James Cloos 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.