Cogs.JsonClass 1.0

The Cogs.JsonClass library is now available in the Cogs project on GitHub.

https://github.com/SeanConnelly/Cogs

Please see the README and the /docs folder on how to use the class.

Overview

The Cogs.JsonClass class provides a one step serialisation and deserialisation to and from Caché registered and persistent classes. It is not dependent on any other code and should be compatible with older versions of Caché.

The unit tests have been included in the update, but until I release the dependent Touchstone unit test solution it won't be possible to run these tests.

Please report any issues on the GitHub issues log.

I will post some benchmarks later in the week.

Sean.

  • + 5
  • 0
  • 466
  • 5

Comments

Cool!

Currently all the classes are in one folder (and as there's 6 classes currently, that's ok), but is there any reason not to separate them further into folders by package?

Agreed, especially as there are hundred+ classes pending for release.

I have an existing sync tool that will automatically export into folders, but I am in the middle of hacking it to work with UDL and a couple of other new features. Until I know its production ready I will do these next few releases of Cogs manually into the same folder (next week or so).

Check my project. This might give you some help planning how to mimic package-to-folder exportation.

https://github.com/rfns/port

Now this is just an idea: I think you should make an API for serializing the JSON available. I mean, not only embed the serializer by extending the target class but also providing a way to serialize without extensions.

There might have cases where the user might need to use the same class for other JSON structures and with the current implementation he could be locked to it since he can't change parameter values on-the-fly.

 

However that implies on implementing a selector system to apply the same effect like each parameter does. So I don't think it's something for now, but you might want to consider it.

Thanks Rubens, port looks really good.

I agree with the extra JSON use case for legacy code.

Will need some thinking about to get similar functionality and performance. Perhaps a just in time code generator that gets cached...

Hi, Sean!

Check Cache-udl tool by [@Oleg Dmitrovich]. It does UDL import/export nicely in following manner:

path/cls/package/class

path/mac/package/routine

path/inc/package/include

path/DFI/Folder/dashboard