JSON_Ext Library

26 views
Skip to first unread message

Larry Rix

unread,
Nov 20, 2020, 11:18:28 AM11/20/20
to Eiffel Users
I suddenly "woke up" to the fact that we (previous project team) had never baked in support for HASH_TABLE <--> JSON.

I have spent the morning getting basic support, plus some needed finesse on the library.

https://github.com/ljr1981/json_ext

This is in the FWIW category. I know there was one person using the library recently.

Basic Changes:

1. There are now fairly simple means for serializing and deserializing HASH_TABLE  [detachable ANY, HASHABLE] objects to and from JSON.

2. There is a JSE_HASH_HANDLER which is a helper class to deal with properly filling target hashes from source in JSON.

3. There are some new features to the TEST_SET_SUPPORT classes for hash or dynamic table-based assertions to make testing for items in hashes a little simpler.

4. Basic renames of some features (adding them and obsoleting the ones they replace).

5. Removed poor naming on some test items that were just confusing.

Jocelyn Fiat

unread,
Nov 20, 2020, 12:23:14 PM11/20/20
to Eiffel Users
Hi Larry,

I think the Eiffel json library already has components for such needs.
(note there is also support for REFLECTOR, and then use the attribute name to serialized to JSON)

The "basic" serialization https://github.com/EiffelSoftware/libraries/blob/master/Src/contrib/library/text/parser/json/library/serialization/deserializer/basic/json_basic_serialization.e is helpful for that , using STRING_TABLE for json object "{ ... }", and ARRAYED_LIST for json array  "[ ... ]"

I hope this helps,
-- Jocelyn

--
You received this message because you are subscribed to the Google Groups "Eiffel Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to eiffel-users...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/eiffel-users/575640e0-0e3e-4305-939c-df0f5e1ba27bn%40googlegroups.com.


--
Jocelyn
------------------------------------------------------------------------
Eiffel Software
https://www.eiffel.com
Customer support: https://support.eiffel.com
User group: https://groups.google.com/forum/#!forum/eiffel-users
------------------------------------------------------------------------

Ulrich Windl

unread,
Nov 23, 2020, 3:35:58 AM11/23/20
to eiffel...@googlegroups.com
Hi!

Actually I think a JSON method should be in a COLLECTION as ARRAYS and HASH_TABLES both sould be supported. Or maybe have a class JSONIZER.

Regards,
Ulrich

>>> Larry Rix <lar...@moonshotsoftware.com> schrieb am 20.11.2020 um 17:18 in
Nachricht <575640e0-0e3e-4305...@googlegroups.com>:

Larry Rix

unread,
Nov 23, 2020, 10:30:45 AM11/23/20
to Eiffel Users
The JSON-ext library was built years ago in Atlanta. I was not the originator of it, but have become the curator of it.

As I recall, the library was built as a higher-level library to help simplify the JSON library. This does not mean that the JSON library does not already facilitate these higher level needs, but it does seem to indicate to me that the JSON library is either lacking in an "easy-to-use" API — OR — it is lacking in clear documentation — OR — both.

As with many libraries, we seem to do an excellent job of creating outstanding code, but we tend to do it at low-levels without clear and fully-fleshed out demonstrations, workflows, and use-cases. Our presentation also lacks. Documentation is one of those hits we take on the chin over and over again.

So—all of that to say a couple of basic things:

1. The JSON-ext library might simply be a reworking of what is already there. I never took the time to explore if the JSON-ext library was even needed. I accepted that the guys who built it did so with firm reasons.

2. The JSON library from Eiffel Software needs much better, simpler, and easily accessed documentation. This is true of many of our libraries and THAT is a matter that I am working to address by way of a number of pathways (videos are such a pathway).

Jocelyn's comment leads me to believe that there is probably a mixture of needed updates to documentation and a smattering of higher-level API classes to uncomplicate use of the library for the user.

As ever, I am open to feedback on the above.

Larry
Reply all
Reply to author
Forward
0 new messages