dotnet / orleans

Cloud Native application framework for .NET
https://docs.microsoft.com/dotnet/orleans
MIT License
10.08k stars 2.03k forks source link

Orleans templates for 2.0.0 #3587

Open attilah opened 7 years ago

attilah commented 7 years ago

With the release of the dotnet templating engine, which is the new way of creating new .Net projects and solutions from the command line and form various IDEs we decided to recreate the previously available templates in the VSIX based on the new engine.

With the Visual Studio 2017 15.3 release it is possible to use the same templates from the IDE too.

For dotnet.exe usage a NuGet package must be installed, for Visual Studio 2017 consumption a separate VSIX needs to be installed.

This work will be based on a previous PR by @galvesribeiro.

The new templating engine will enable the adding of logic to the templates, so more complex, interactive templates can be developed in the future.

To enable separate versioning, development and release from Orleans itself we'll have the new templates in a separate GitHub repository.

We looking forward for community suggested templates, please use this issue to give us ideas, what would be the greatest help in form of templates for you.

Resources for template authoring:

ashkan-saeedi-mazdeh commented 7 years ago

Ah nice thing to add.

I've tried to change Orleans templates themselves once but could not manage to find the time but I thought about it before. Based on my experience a solution template where it defines an interfaces project, an implementation one and a host is something which should be there for fast creation of test projects.

Maybe there should be a host project for dev/test and one for production (or multiple ones) using Azure membership table and ... The big park templates were good but having one which creates all projects at the same time is very nice too.

If you want to add interactive stuff then we can ask the user to choose

but I'm not sure if that is helpful that much. Usually these things change during the life-time of the project.

galvesribeiro commented 7 years ago

@attilah should I close my previous PR? Or do you want me to complete it as the .net CLI part of the templates?

Also, for suggestion of templates, I would like to have the following:

+ Project Template
--- Grain Interface
--- Grain Implementation
--- Silo
--- Client
--- Custom Providers (stream, storage, membership)
+ Type Template
--- Grain Implementation Class
--- Grain Interface
--- Storage Provider
--- Stream Provider
--- Membership provider

At the new template engine, we can ask some questions while create both project and type template instances. For example, when creating a grain class, what are the storage/stream providers the user want to put on that and what is the State type to be used?

The new templating engine is really nice and is becoming a scaffolding engine like yeoman for example.

attilah commented 7 years ago

We'll build and rework on top of that, I think we should close it when initial release happened for chronological order ;-)

attilah commented 7 years ago

@galvesribeiro the only thing with "asking question" is that the VS counterpart has no generic UI for that so in VS everything will be generated with the default values. There are ways to have a piece of UI there easily, hopefully I'll have time to do some prototype after the initial release and so the community can jump onto that ;-)

attilah commented 7 years ago

@galvesribeiro also we can think in multi project templates, not just item/project templates, like a starter kit.

galvesribeiro commented 7 years ago

the only thing with "asking question" is that the VS counterpart has no generic UI for that so in VS everything will be generated with the default values

Yeah I know. I wonder how Asp.Net team got that "new project" UI which after that, select if it is web api, blank, or web app...

also we can think in multi project templates, not just item/project templates, like a starter kit.

We can use as example what dotnet new sln does, and create not just the .sln but the "starter kit" structure with projects as well.

My point is, to have the new types asking which providers to use is a good thing.

attilah commented 7 years ago

Yeah I know. I wonder how Asp.Net team got that "new project" UI which after that, select if it is web api, blank, or web app...

That is the easy part ;-) Just someone need to code that dialog, everything before and after is already covered by VS15.3.

creyke commented 6 years ago

Please consider a web api with grains as a template as in #3190...

...this would (arguably) be huge for traditional Asp.Net devs.