You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@felix.apache.org by Carsten Ziegeler <cz...@apache.org> on 2017/01/18 13:10:36 UTC

Removing json.org dependency from webconsole and plugins

Hi,

as Jim has explained in [1] we have to remove the usage of the json.org
library from our code base as the licence is not in the excepted
category anymore. This does not affect released code.

Now, before we get into a discussion about the best json library on
earth, let's reduce the discussion to the webconsole and the plugins first.
If we look at how json.org is used in this code, it is only used for
writing json. No parsing, nothing fancy at all.

I recently removed the usage of json.org code in the DS web console
plugin and created a simple JSONWriter [2]. And that's actually all we
need in the webconsole and our plugins.

So my suggestion is:
- we add the writer from [1] to a new package in the web console and
export it.
- plugins can be changed to use that writer and decide whether they just
import that package or simply embed that single class.

This removes most of the usage with one ugly exception:
The org.apache.felix.webconsole.WebConsoleUtils class is using json.org
directly in its api and WebConsoleUtils is exported api.

It contains only a small helper method and replacing that usage is very
easy. The method is deprecated for a long time.

In order to create the least disruption for existing plugins, I suggest we:
- remove that method from the API
- do *not* increase the major version of the API to allow all plugins to
continue to run unless they use the method

I know that is not following the semantic versioning and might create
problems for existing plugins. But I don't think the method is widely used

WDYT?

Regards
Carsten

[1]
https://mail-archives.apache.org/mod_mbox/www-legal-discuss/201611.mbox/%3C0CE2E8C9-D9B7-404D-93EF-A1F8B07189BF@apache.org%3E
[2]
https://svn.apache.org/repos/asf/felix/trunk/webconsole-plugins/ds/src/main/java/org/apache/felix/webconsole/plugins/ds/internal/
-- 
Carsten Ziegeler
Adobe Research Switzerland
cziegeler@apache.org


Re: Removing json.org dependency from webconsole and plugins

Posted by Carsten Ziegeler <cz...@apache.org>.
Achim Nierbeck wrote
> Hi,
> 
> just trying to be the devil's advocate :)
> 
> Even if it's a small piece of code just for writing JSON, do we really
> re-invent the wheel again?
> Don't know if you where aware of, but there is an Apache JSON lib
> available, and it does have the proper imports/exports ;)
> Apache Johnzon [1]
> 
Thanks, yes of course I know it.
But this creates a dependency to johnzon-core and the api, for just a
tiny json writer. For general json handling I would use that lib, but
for the use case at hand, it is not necessary.

Carsten

 

-- 
Carsten Ziegeler
Adobe Research Switzerland
cziegeler@apache.org

Re: Removing json.org dependency from webconsole and plugins

Posted by Achim Nierbeck <bc...@googlemail.com>.
Hi,

just trying to be the devil's advocate :)

Even if it's a small piece of code just for writing JSON, do we really
re-invent the wheel again?
Don't know if you where aware of, but there is an Apache JSON lib
available, and it does have the proper imports/exports ;)
Apache Johnzon [1]

regards, Achim

[1] - http://johnzon.apache.org/



2017-01-18 14:10 GMT+01:00 Carsten Ziegeler <cz...@apache.org>:

> Hi,
>
> as Jim has explained in [1] we have to remove the usage of the json.org
> library from our code base as the licence is not in the excepted
> category anymore. This does not affect released code.
>
> Now, before we get into a discussion about the best json library on
> earth, let's reduce the discussion to the webconsole and the plugins first.
> If we look at how json.org is used in this code, it is only used for
> writing json. No parsing, nothing fancy at all.
>
> I recently removed the usage of json.org code in the DS web console
> plugin and created a simple JSONWriter [2]. And that's actually all we
> need in the webconsole and our plugins.
>
> So my suggestion is:
> - we add the writer from [1] to a new package in the web console and
> export it.
> - plugins can be changed to use that writer and decide whether they just
> import that package or simply embed that single class.
>
> This removes most of the usage with one ugly exception:
> The org.apache.felix.webconsole.WebConsoleUtils class is using json.org
> directly in its api and WebConsoleUtils is exported api.
>
> It contains only a small helper method and replacing that usage is very
> easy. The method is deprecated for a long time.
>
> In order to create the least disruption for existing plugins, I suggest we:
> - remove that method from the API
> - do *not* increase the major version of the API to allow all plugins to
> continue to run unless they use the method
>
> I know that is not following the semantic versioning and might create
> problems for existing plugins. But I don't think the method is widely used
>
> WDYT?
>
> Regards
> Carsten
>
> [1]
> https://mail-archives.apache.org/mod_mbox/www-legal-discuss/201611.mbox/%
> 3C0CE2E8C9-D9B7-404D-93EF-A1F8B07189BF@apache.org%3E
> [2]
> https://svn.apache.org/repos/asf/felix/trunk/webconsole-
> plugins/ds/src/main/java/org/apache/felix/webconsole/plugins/ds/internal/
> --
> Carsten Ziegeler
> Adobe Research Switzerland
> cziegeler@apache.org
>
>


-- 

Apache Member
Apache Karaf <http://karaf.apache.org/> Committer & PMC
OPS4J Pax Web <http://wiki.ops4j.org/display/paxweb/Pax+Web/> Committer &
Project Lead
blog <http://notizblog.nierbeck.de/>
Co-Author of Apache Karaf Cookbook <http://bit.ly/1ps9rkS>

Software Architect / Project Manager / Scrum Master