Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[ModGen] List factories #8

Open
c3dr0x opened this issue Jun 7, 2018 · 1 comment
Open

[ModGen] List factories #8

c3dr0x opened this issue Jun 7, 2018 · 1 comment
Labels
enhancement New feature or request

Comments

@c3dr0x
Copy link
Member

c3dr0x commented Jun 7, 2018

The list factories being analysed with reflection from a DLL causes several issues. When people generate the model they need to be sure to have build before hand the project containing the factories. Otherwise lists aren't generated correctly. Furthermore the release of kinetix-core having different projects, the loading and use of reflection is not possible anymore if we want to keep a unified gen for both frameworks.
The factories should be extracted into json files.

@durandx durandx added the enhancement New feature or request label Jul 5, 2018
@c3dr0x
Copy link
Member Author

c3dr0x commented Jul 5, 2018

I propose the following format for files:

// staticListFactory.json 
{
	"MyRefList": {
		"Value1": {
			"Code": "CODE_1",
			"Label": "reference.myEntity.value1"
		},
		"Value2": {
			"Code": "CODE_2",
			"Label": "reference.myEntity.value2"
		}
	}
}

It will correspond to the old:

// StaticListFactory.cs
using Kinetix.ServiceModel;

namespace Project.Common 
{
    /// <summary>Factory des listes statiques.</summary>
    public sealed class StaticListFactory : AbstractListFactory 
    {
        /// <summary>Obtient si cette factory initialise les listes statiques.</summary>
        public override bool IsStatic => true;

        /// <summary>Initialisation des listes statiques.</summary>
        public override void Init() 
        {
            AddTable("MyRefList")
               .AddItem("Value1", new { Code = "CODE_1", Label = "reference.myRefList.value1" })
               .AddItem("Value2", new { Code = "CODE_2", Label = "reference.myRefList.value2" });
        }
    }
}

see: get-focus/kinetix-tools@3d5ac00

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants