-
Notifications
You must be signed in to change notification settings - Fork 177
External interface change from version 0.4 to 0.5
I have changed the design, so the JSONClient, SOAPClient, JSONServer and SOAPServer implements IClientAPI or IServerAPI, this is instead of inheriting from Client and Server.
The external interface was exposing some abstract classes (Client/Server) from the core, which made them hard to refactor or change. To solve this I have used the bridge pattern and created two abstractions, one as a driver and the other as the implementation. This makes it possible to change implementations without affect to the external interfaces. Some quick wins by doing this:
- I can refactor the client/Server into more precise classes.
- I change some bad design choices and better use dependency injection.
- I transformed the JSONClient (and the like) into composite roots.
- I can now restructure the project for the next OCPP version.
This shouldn't effect you, if you only stick to the concrete types. Example:
SOAPServer server = new SOAPServer(serverCoreProfile);
For server, you have to change the following:
Server server = new SOAPServer(serverCoreProfile);
To this:
IServerAPI server = new SOAPServer(serverCoreProfile);
For Client, you have to change the following:
Client client = new JSONClient(core, "test", false);
To this:
IClientAPI client = new JSONClient(core, "test", false);
If you need any help, then please don't hesitate to get in touch:
- chat: https://gitter.im/ChargeTimeEU/Java-OCA-OCPP
- e-mail: tv@chargetime.eu
- or create a issue here on github.
I will do my very best to help.
- Thomas Volden