Skip to content
This repository has been archived by the owner on Jan 19, 2024. It is now read-only.

Extend the project init tool with a library of project templates #2

Open
jolly-fellow opened this issue Jan 29, 2023 · 1 comment · May be fixed by #8
Open

Extend the project init tool with a library of project templates #2

jolly-fellow opened this issue Jan 29, 2023 · 1 comment · May be fixed by #8

Comments

@jolly-fellow
Copy link
Contributor

Add a library of the project templates where implemented a basic and often used functionality.

Create not an empty project but a project based on a specific template chosen by the user. Something like a wizard of new projects from the MS Visual Studio or MS Office.

We may make a set of templates for different kinds of projects and allow the user to generate his project based on such templates. I think it would be nice if the user could choose not only technical features of his new contract project like programming language, dependencies, etc. but a template of the project for his business needs where already implemented a typical solution. It may look like a wizard from Windows which asks a set of questions and generates a stub contract project with requested functionality.

Also it would be good to allow the users to extend the template library. There are hundreds of business needs which may be generalized in templates of the contracts. We can't predict and implement (and even understand) them all. But a user who specializes in some types of contracts may make templates for himself and create needed contracts based on these templates. Everyone can write the code of contract, generalize it by adding several macros to right places, copy it to the template library and generate projects based on them. For new users this library will be a good set of examples for quick start. Wizard here is not exactly a GUI but mostly an idea to ask more and more detailed questions based on previous answers. This is using a binary search principle to quickly make a setting based on a big number of choices.

How it may works:

The tool reads all given information and based on this information chooses a template for a contract project for a given programming language and the given business purposes from a template library and copies the template into the given directory. Then the tool calls a macro processor (m4 or similar) with collected information for each file of the chosen project. The macro processor changes all macros in the files of the project to actual values. It makes the project ready for development.

A simplest way how the project templates may be organized is a hierarchy of directories like this:

tree

​​​​Of course the templates may be organized in many different ways. Even as a public repository or some kind of library. I just want to describe an idea which gives a lot of working examples to the new users and as a set of basic projects to help users to write new contracts. It may have different implementations. Anyway every programmer collects his own set of basic projects which he uses often. As I know there are even a special kind of programmers on the labor market who specialize in writing smart contracts.

@jolly-fellow jolly-fellow linked a pull request Mar 6, 2023 that will close this issue
@stephenpdeos
Copy link
Member

We will hold off on this proposal for now, pending Bucky's secondary proposal where we will review all possibilties together.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
Status: Todo
Development

Successfully merging a pull request may close this issue.

2 participants