PowerType refactoring

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

PowerType refactoring

grampajohn
Administrator
To address Issue #165, I have refactored common.enumerations.PowerType into an ordinary class that behaves almost exactly like an enum, with added features that let you get the most generic type (CONSUMPTION, PRODUCTION, STORAGE) and answer queries about categories. This seems to work fine except in cases where a switch was being used (there's an example in factored-customer) to accomplish the same thing. I have updated factored-customer to correct this problem, but there may be some broker code that will get tripped up by this. In the end, I hope you agree it's a big improvement.

Cheers -

John
Reply | Threaded
Open this post in threaded view
|

Re: PowerType refactoring

grampajohn
Administrator
This post was updated on .

This note is for users of the grails demo broker and the development version of the server.

If you are using the grails-demo agent with the 0.1.0 release server, and have not already cloned it, you will need to use a new branch called spring-server-0.1. The agent on branch spring-server now depends on common:0.2.0-SNAPSHOT.

If you are developing the server or using the bleeding-edge server for your broker work, this is to let you know what you have to do when the common module gets changed. The change in this case is a fix for issue #165, which involves a change in representation of PowerType (it's not an enum any longer) and corresponding changes in the way it's serialized and deserialized. The changes affect factored-customer, and the grails demo agent. Here's what you have to do to get everything back in sync:

  • update common (git pull origin master) and then run mvn clean install on it so the server sees it.
  • update factored-customer
  • if you are using the grails-demo broker, update that to the latest on the spring-master branch, which uses the new common module.

Remember, in general when you pull down a change to the common module, you need to install it with maven, because otherwise the other components are unlikely to see the change.

Cheers -

John