polygene-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Niclas Hedhman <nic...@hedhman.org>
Subject Re: Yeoman generator
Date Sat, 11 Mar 2017 10:05:45 GMT
Gang,
I have now added support for properties/associations inside the model json
that one can pass into the generator.

"cruds" is a term that I came up with for those types that are both
entities and values.

All this seems to work quite well. On my system, the model below is built
with Gradle in 4.2 seconds. I have not generated any tests yet, pretty much
because I don't know what tests to generate. Maybe one AbstractPolygeneTest
per composite type. If it is an entity, set up an MemoryEntityStore....
what else?

Feel free to wish, I quite pumped about this now...  :-)

{
  "name": "Sink",
  "packageName": "com.sensetif.sink",
  "singletonApp": false,
  "features": [
    "rest api"
  ],
  "entitystore": "Geode",
  "indexing": "ElasticSearch",
  "caching": "EhCache",
  "serialization": "Stax",
  "modules": {
    "user": {
      "cruds": [
        { "name": "Users" },
        { "name": "Roles" },
        { "name": "User" },
        { "name": "Role" },
        { "name": "Permission" },
        { "name": "Group" },
        { "name": "Groups" }
      ],
      "services": [
        {
          "name": "AuthService",
          "visibility": "application",
          "configuration" : [
            { "name": "backend", "type": "java.lang.String" },
            { "name": "connectString", "type": "java.lang.String" }
          ]
        }
      ]
    },
    "organization": {
      "cruds": [
        {"name": "Organizations"},
        {
          "name": "Organization",
          "properties": [
            { "name": "name", "type": "java.lang.String" },
            { "name": "created", "type": "java.time.Instant" }
          ]
        },
        { "name": "Project" }
      ],
      "entities": [
        { "name": "Invoice" }
      ],
      "values": [
        {
          "name": "CreditLimit",
          "properties" : [
            { "name" : "amount", "type" : "java.math.BigDecimal" },
            { "name" : "currency", "type" : "java.lang.String" }
          ]
        }
      ],
      "transients": [
        { "name": "OrderConfirmation" }
      ],
      "objects": [
        { "name": "PaypalNotification" }
      ]
    },
    "sensor": {
      "cruds": [
        { "name": "SensorData" }
      ],
      "entities": [
        { "name": "Sensor" },
        { "name": "PollSchedule" }
      ]
    }
  }
}


On Sat, Mar 11, 2017 at 9:02 AM, Niclas Hedhman <niclas@hedhman.org> wrote:

> Hi,
> Last night I made a big improvement on the generator-polygene, making a
> lot easier to work with the codebase (modular, creation-by-convention,...).
> Still room for improvement in that area, but it is now miles better.
>
> I am toying with the idea of generating ALL possible projects in the
> integration tests, to ensure that no conflict exists, or that something is
> missed in some combination. But my Groovy-Fu is just not "there", and I
> don't want to look "silly" by having a Java program with Groovy syntax.
>
> In essence, generate 2688 JSON documents with all possible combinations,
> and pass them one by one to a command line.
>
> Why so many?
>
> 1 of 14 entitiy stores
>   x
> 1 of 4 indexing
>   x
> 1 of 2 serialization
>   x
> 1 of 3 caching
>   x
> 1 of 2 metrics
>   x
> each of 2 features (4 combos)
>
> And with each other feature I add, the number doubles, so perhaps not
> doable in the long run, as I intend to include the following features
> eventually;
>
>   'rest api'
>  ,'security'
> // ,'version migration'
> // ,'logging'
> // ,'jmx'
> // ,'circuit breakers'
> // ,'file transactions'
> // ,'spring integration'
> // ,'servlet deployment'
> // ,'osgi support'
> // ,'alarms'
> // ,'scheduling'
> // ,'groovy mixins'
> // ,'javascript mixins'
>
>
> Other things that I am working on are;
>   * Support for adding Domain Layer modules with entities, values,
> objects....
>   * Support for different application types; Rest, command line, WAR,
> Docker(?)
>   * Post creation-time, creation of new modules with entities, values,
> objects....
>   * and hopefully, post creation-time addition of features.
>
> The last two are of course very tricky, since humans may have been
> tinkering with files, so perhaps that is a pipe-dream.
>
> Anyway, if anyone could help out with the tests, then this could be
> wrapped up pretty quickly. Meanwhile, I will continue on the other features.
>
>
> Cheers
> --
> Niclas Hedhman, Software Developer
> http://polygene.apache.org <http://zest.apache.org> - New Energy for Java
>



-- 
Niclas Hedhman, Software Developer
http://polygene.apache.org <http://zest.apache.org> - New Energy for Java

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message