Component DSL

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

Component DSL

Raymond Auge
Hello All,

My very shy colleague Carlos has just added a very nice new project in Aries here [1] called "component-dsl"

It's a functional DSL for OSGi.

- Ray

[1] http://svn.apache.org/repos/asf/aries/trunk/component-dsl/

Reply | Threaded
Open this post in threaded view
|

Re: Component DSL

Matt Sicker
Looks very cool!

On 24 November 2016 at 11:19, Raymond Auge <[hidden email]> wrote:
Hello All,

My very shy colleague Carlos has just added a very nice new project in Aries here [1] called "component-dsl"

It's a functional DSL for OSGi.

- Ray

[1] http://svn.apache.org/repos/asf/aries/trunk/component-dsl/




--
Matt Sicker <[hidden email]>
Reply | Threaded
Open this post in threaded view
|

Re: Component DSL

Jean-Baptiste Onofré
In reply to this post by Raymond Auge
Hi Ray,

interesting !

Thanks for sharing.

Maybe at some point, we can migrate the repo to git (and use github
integration). No rush, but it could be cool.

Regards
JB

On 11/24/2016 06:19 PM, Raymond Auge wrote:

> Hello All,
>
> My very shy colleague Carlos has just added a very nice new project in
> Aries here [1] called "component-dsl"
>
> It's a functional DSL for OSGi.
>
> - Ray
>
> [1] http://svn.apache.org/repos/asf/aries/trunk/component-dsl/
>

--
Jean-Baptiste Onofré
[hidden email]
http://blog.nanthrax.net
Talend - http://www.talend.com
Reply | Threaded
Open this post in threaded view
|

Re: Component DSL

Guillaume Nodet-2
In reply to this post by Raymond Auge
Thx ! Do you have a few tests / examples that could demonstrate the possibilities of this dsl ?

2016-11-24 18:19 GMT+01:00 Raymond Auge <[hidden email]>:
Hello All,

My very shy colleague Carlos has just added a very nice new project in Aries here [1] called "component-dsl"

It's a functional DSL for OSGi.

- Ray

[1] http://svn.apache.org/repos/asf/aries/trunk/component-dsl/




--
------------------------
Guillaume Nodet
------------------------
Red Hat, Open Source Integration


Reply | Threaded
Open this post in threaded view
|

Re: Component DSL

David Bosschaert
On 25 November 2016 at 06:57, Guillaume Nodet <[hidden email]> wrote:
Thx ! Do you have a few tests / examples that could demonstrate the possibilities of this dsl ?


+1

Just noticed that the code doesn't contain any tests at all. I think we should try to have at least a reasonable level of junit test coverage for Aries components...

Thanks,

David 
Reply | Threaded
Open this post in threaded view
|

Re: Component DSL

Felix Meschberger
In reply to this post by Raymond Auge
Nice idea !

One nitpick (apart from what has already been mentioned): I am a bit hit by the heavy use of the string „OSGi“ in the class and interface names. Would that be something that could be adapted to be something more meaningfull ?

Regards
Feölix

Am 24.11.2016 um 18:19 schrieb Raymond Auge <[hidden email]>:

Hello All,

My very shy colleague Carlos has just added a very nice new project in Aries here [1] called "component-dsl"

It's a functional DSL for OSGi.

- Ray

[1] http://svn.apache.org/repos/asf/aries/trunk/component-dsl/


Reply | Threaded
Open this post in threaded view
|

Re: Component DSL

Carlos Sierra Andrés
In reply to this post by David Bosschaert

Yes... that's my bad only :(

I hadn't decided yet how to bootstrap the test environment. I saw that some modules use pax-exam, others enRoute (or bnd test). I personally am acquainted to arquillian but I did not want to bring in a new test framework.

Should I just use bnd-test? Any suggestions?

El 25/11/16 a las 11:07, David Bosschaert escribió:
On 25 November 2016 at 06:57, Guillaume Nodet <[hidden email]> wrote:
Thx ! Do you have a few tests / examples that could demonstrate the possibilities of this dsl ?


+1

Just noticed that the code doesn't contain any tests at all. I think we should try to have at least a reasonable level of junit test coverage for Aries components...

Thanks,

David 

--
Carlos Sierra
Core Engineer
Liferay España y Portugal / Liferay Spain and Portugal
Tel. +34 917336343
www.liferay.com


Enterprise. Open Source. For Life.

Visit Us: www.liferay.com  |  Like Us: facebook.com/liferay  |  Follow Us: twitter.com/liferay_es

AVISO DE CONFIDENCIALIDAD: “La información contenida en este mensaje y/o archivo(s) adjunto(s), enviada desde LIFERAY SL, es confidencial/privilegiada y está destinada a ser leída sólo por la(s) persona(s) a la(s) que va dirigida. Le recordamos que sus datos han sido incorporados en un fichero y que siempre y cuando se cumplan los requisitos exigidos por la normativa, podrá ejercer los derechos de acceso, rectificación, cancelación y oposición, ante nuestra entidad.

Si usted lee este mensaje y no es el destinatario señalado, el empleado o el agente responsable de entregar el mensaje al destinatario, o ha recibido esta comunicación por error, le informamos que está totalmente prohibida, y puede ser ilegal, cualquier divulgación, distribución o reproducción de esta comunicación, y le rogamos que nos lo notifique inmediatamente y nos devuelva el mensaje original a la dirección arriba mencionada. Gracias.” 

"The information contained in this message and any attached file(s) sent by Liferay SL is confidential / privileged and intended solely for the addressee(s). If you are not the intended recipient, any form of disclosure, reproduction, distribution or any action taken or refrained from in reliance on it, is prohibited and may be unlawful. Please notify the sender immediately and destroy this e-mail. Thank you."

Reply | Threaded
Open this post in threaded view
|

Re: Component DSL

Carlos Sierra Andrés
In reply to this post by Guillaume Nodet-2

Hey... sorry for the lack of tests... I will create them for each of the "primitives" and also for the composition.

In the meanwhile, I will try to use the DSL to modify some existing code to show the equivalence and push it.

Nevertheless it is still in an early stage so the API will surely be extended/modified to incorporate (hopefully) better ways to tackle the use cases.

Bests.

El 25/11/16 a las 7:57, Guillaume Nodet escribió:
Thx ! Do you have a few tests / examples that could demonstrate the possibilities of this dsl ?

2016-11-24 18:19 GMT+01:00 Raymond Auge <[hidden email]>:
Hello All,

My very shy colleague Carlos has just added a very nice new project in Aries here [1] called "component-dsl"

It's a functional DSL for OSGi.

- Ray

[1] http://svn.apache.org/repos/asf/aries/trunk/component-dsl/




--
------------------------
Guillaume Nodet
------------------------
Red Hat, Open Source Integration



--
Carlos Sierra
Core Engineer
Liferay España y Portugal / Liferay Spain and Portugal
Tel. +34 917336343
www.liferay.com


Enterprise. Open Source. For Life.

Visit Us: www.liferay.com  |  Like Us: facebook.com/liferay  |  Follow Us: twitter.com/liferay_es

AVISO DE CONFIDENCIALIDAD: “La información contenida en este mensaje y/o archivo(s) adjunto(s), enviada desde LIFERAY SL, es confidencial/privilegiada y está destinada a ser leída sólo por la(s) persona(s) a la(s) que va dirigida. Le recordamos que sus datos han sido incorporados en un fichero y que siempre y cuando se cumplan los requisitos exigidos por la normativa, podrá ejercer los derechos de acceso, rectificación, cancelación y oposición, ante nuestra entidad.

Si usted lee este mensaje y no es el destinatario señalado, el empleado o el agente responsable de entregar el mensaje al destinatario, o ha recibido esta comunicación por error, le informamos que está totalmente prohibida, y puede ser ilegal, cualquier divulgación, distribución o reproducción de esta comunicación, y le rogamos que nos lo notifique inmediatamente y nos devuelva el mensaje original a la dirección arriba mencionada. Gracias.” 

"The information contained in this message and any attached file(s) sent by Liferay SL is confidential / privileged and intended solely for the addressee(s). If you are not the intended recipient, any form of disclosure, reproduction, distribution or any action taken or refrained from in reliance on it, is prohibited and may be unlawful. Please notify the sender immediately and destroy this e-mail. Thank you."

Reply | Threaded
Open this post in threaded view
|

Re: Component DSL

Carlos Sierra Andrés
In reply to this post by Felix Meschberger

Thx!

absolutely! This is preliminary work and I will be more than happy to collect ideas and suggestions from everybody!

Carlos.


El 25/11/16 a las 11:53, Felix Meschberger escribió:
Nice idea !

One nitpick (apart from what has already been mentioned): I am a bit hit by the heavy use of the string „OSGi“ in the class and interface names. Would that be something that could be adapted to be something more meaningfull ?

Regards
Feölix

Am 24.11.2016 um 18:19 schrieb Raymond Auge <[hidden email]>:

Hello All,

My very shy colleague Carlos has just added a very nice new project in Aries here [1] called "component-dsl"

It's a functional DSL for OSGi.

- Ray

[1] http://svn.apache.org/repos/asf/aries/trunk/component-dsl/


Reply | Threaded
Open this post in threaded view
|

Re: Component DSL

David Bosschaert
In reply to this post by Carlos Sierra Andrés
Hi Carlos,

In many cases it might sense to create pure unit tests and mock the external objects using something like mockito.

For integration tests, in Aries pax-exam is mostly used for that I think. But another framework like bnd-test should be perfectly fine from my pov...

Thanks!

David

On 25 November 2016 at 11:16, Carlos Sierra Andrés <[hidden email]> wrote:

Yes... that's my bad only :(

I hadn't decided yet how to bootstrap the test environment. I saw that some modules use pax-exam, others enRoute (or bnd test). I personally am acquainted to arquillian but I did not want to bring in a new test framework.

Should I just use bnd-test? Any suggestions?

El 25/11/16 a las 11:07, David Bosschaert escribió:
On 25 November 2016 at 06:57, Guillaume Nodet <[hidden email]> wrote:
Thx ! Do you have a few tests / examples that could demonstrate the possibilities of this dsl ?


+1

Just noticed that the code doesn't contain any tests at all. I think we should try to have at least a reasonable level of junit test coverage for Aries components...

Thanks,

David 

--
Carlos Sierra
Core Engineer
Liferay España y Portugal / Liferay Spain and Portugal
Tel. +34 917336343
www.liferay.com


Enterprise. Open Source. For Life.

Visit Us: www.liferay.com  |  Like Us: facebook.com/liferay  |  Follow Us: twitter.com/liferay_es

AVISO DE CONFIDENCIALIDAD: “La información contenida en este mensaje y/o archivo(s) adjunto(s), enviada desde LIFERAY SL, es confidencial/privilegiada y está destinada a ser leída sólo por la(s) persona(s) a la(s) que va dirigida. Le recordamos que sus datos han sido incorporados en un fichero y que siempre y cuando se cumplan los requisitos exigidos por la normativa, podrá ejercer los derechos de acceso, rectificación, cancelación y oposición, ante nuestra entidad.

Si usted lee este mensaje y no es el destinatario señalado, el empleado o el agente responsable de entregar el mensaje al destinatario, o ha recibido esta comunicación por error, le informamos que está totalmente prohibida, y puede ser ilegal, cualquier divulgación, distribución o reproducción de esta comunicación, y le rogamos que nos lo notifique inmediatamente y nos devuelva el mensaje original a la dirección arriba mencionada. Gracias.” 

"The information contained in this message and any attached file(s) sent by Liferay SL is confidential / privileged and intended solely for the addressee(s). If you are not the intended recipient, any form of disclosure, reproduction, distribution or any action taken or refrained from in reliance on it, is prohibited and may be unlawful. Please notify the sender immediately and destroy this e-mail. Thank you."


Reply | Threaded
Open this post in threaded view
|

Re: Component DSL

Carlos Sierra Andrés
In reply to this post by Guillaume Nodet-2

Hi again...

I uploaded an example on using the component dsl.

https://github.com/csierra/osgi-jaxrs-extracted/pull/8/commits/12f92a61d0e8cd0dbf630a806ac0a31af1ca5934#diff-b7c2953bc9bc598a22c5481f9681e181R120

so this basically tracks every service with a property jaxrs.application.select. For each of those it looks for any CXFJaxRsServiceRegistrator that matches the filter contained in the jaxrs.application.select property of the other service. When it finds a match it registers the endpoint in the registrator.

When any of the dependencies, be it the service or the registrator, goes away it closes the "branches" corresponding to those instances closing the trackers and unreferencing the services. The idea is to build a fairly complete set of "primitives" that allow to operate with services in a safe way trying to avoid leaks as much as possible.

Here https://github.com/csierra/osgi-jaxrs-extracted/pull/8/commits/12f92a61d0e8cd0dbf630a806ac0a31af1ca5934#diff-b7c2953bc9bc598a22c5481f9681e181R103 you can see another snippet. In this case it registers two services in the framework, a Bus and a Servlet. When any of the dependencies goes away the services are unregistered. Together with the "primitives" for configuration you can get something quite similar to STATIC in DS but without the need of any annotation and using the original third party classes.

This is just a first approach. I would like to refine the set of primitives to make them as useful as possible.

One obvious caveat is the horrible syntax. On a bright side, it should be possible to use this from Scala confortably.

Carlos.

El 25/11/16 a las 7:57, Guillaume Nodet escribió:

Thx ! Do you have a few tests / examples that could demonstrate the possibilities of this dsl ?

2016-11-24 18:19 GMT+01:00 Raymond Auge <[hidden email]>:
Hello All,

My very shy colleague Carlos has just added a very nice new project in Aries here [1] called "component-dsl"

It's a functional DSL for OSGi.

- Ray

[1] http://svn.apache.org/repos/asf/aries/trunk/component-dsl/




--
------------------------
Guillaume Nodet
------------------------
Red Hat, Open Source Integration