You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@abdera.apache.org by Remy Gendron <re...@arrova.ca> on 2008/03/06 21:36:42 UTC

Abdera / Spring sample application

Hello all,

I have put together an Abdera server sample application that serves movies,
actors and roles (data taken from IMDB).

The com.lacapitale.iex package is the glue code (or framework) part. The
com.lacapitale.imdb is the example application.

It demonstrates the following:

* Application layering
  * DAO
  * Services
  * Services APIs
  * REST
* Domain objects
  * Domain objects used as DTOs
  * Clients of the service layer only access the domain objects thru
interfaces that restricts access to certain fields, thus preventing business
rules from being coded in the UI.
* Spring integration:
  * Auto discovery of adapters.
  * Auto wiring of all dependencies.
  * An example (ServiceContextBean) of a request scoped bean that decouples
the services layer from Abdera.
  * Jdbc templates.
  * MySQL DAOs to come later. DAO type selection would be done by a Spring
auto discovery filter.
* Abdera
  * Automatic construction of the entry.content element thru reflection of
the domain objects' implemented interfaces.
  * Collection paging. 
* Unit testing
  * In memory HSQLDB.
  * Jetty container.
  * Base REST test class that starts HSQLDB, loads the test db scripts,
starts Jetty/Spring/Abdera/IMDB.
  * Base adapter test class that provides around 15 generic feed tests.
  * Abstract DB unit test wrapper to load test data from sql scripts (MySQL
support to come).
  * Unit tests for good application dependencies enforcement between the
layers.
* Misc
  * Java configuration instead of XML or properties.

This is a work in progress. No Javadoc yet. Any comments are welcome.
I don't suggest providing a Spring integration with Abdera, the way to do it
depends to much on individual taste.
However, this could become part of the Wiki.

You can get the project here: http://arrova.ca/files/imdb.rar

Remy

The dependencies are not included. Spring 2.5.1 was used. Here's my
dependencies folder content:

abdera-i18n-0.4.0-incubating-SNAPSHOT.jar
abdera.client.0.4.0-incubating-SNAPSHOT.jar
abdera.core.0.4.0-incubating-SNAPSHOT.jar
abdera.parser.0.4.0-incubating-SNAPSHOT.jar
abdera.protocol.0.4.0-incubating-SNAPSHOT.jar
abdera.security.0.4.0-incubating-SNAPSHOT.jar
abdera.server.0.4.0-incubating-SNAPSHOT.jar
abdera.spring.0.4.0-incubating-SNAPSHOT.jar
axiom-api-1.2.5.jar
axiom-impl-1.2.5.jar
bcprov-jdk15-137.jar
commons-codec-1.3.jar
commons-el.jar
commons-httpclient-3.1.jar
commons-logging-1.0.4.jar
geronimo-activation_1.0.2_spec-1.1.jar
geronimo-servlet_2.4_spec-1.0.jar
hsqldb.jar
htmlparser-1.0.5.jar
jaxen-1.1.1.jar
jdepend-2.9.jar
jetty-6.1.3.jar
jetty-util-6.1.3.jar
json-1.0.jar
junit-4.4.jar
log4j-1.2.14.jar
myfaces-api.jar
myfaces-impl.jar
ojdbc14.jar
serializer.jar
spring-test.jar
spring.jar
stax-api-1.0.1.jar
tomahawk.jar
wstx-asl-3.2.1.jar
xmlsec-1.4.1.jar
xpp3_min-1.1.4c.jar
xstream-1.3.jar




No virus found in this outgoing message.
Checked by AVG Free Edition. 
Version: 7.5.516 / Virus Database: 269.21.6/1315 - Release Date: 2008.03.06
09:07
 


Re: Abdera / Spring sample application

Posted by David Calavera <da...@gmail.com>.
On Fri, Mar 7, 2008 at 3:13 PM, Remy Gendron <re...@arrova.ca> wrote:

> Hello David,
>
> I also much prefer the annotations over the XML configuration. Some will
> tell you that annotations are bad because they introduce dependencies
> between every one of your classes and the Spring framework, as you have to
> import those annotations into the classes.
>
> However, I find this argument weak as, if I write my app with Spring, I
> will
> not go overboard to prevent dependencies on Spring. I don't need the
> option
> of migrating my app to another light weight container.


Totally agree, it's supposed that you choose a framework because you think
that's the best option for your project, why do you want to change it in the
middle of a project development?

>
>
> Of course, I'm all in favour of good layering and decoupling where
> appropriate and where the cost of it can or could be leveraged down the
> road. This is exemplified by my usage of interfaces over my domain objects
> instead of using true DTOs. My dependencies unit test also makes sure
> these
> principles are enforced.
>
> I haven't done any Ruby (yet) but I like the direction Abdera is taking by
> favouring convention over configuration.
>

I like it too XD.


>
> Keep up the good work! Thanks again... I look a lot smarter at work
> because
> of you all!
>
> Remy
>
> -----Original Message-----
> From: David Calavera [mailto:david.calavera@gmail.com]
> Sent: March 06, 2008 17:07
> To: abdera-user@incubator.apache.org
> Subject: Re: Abdera / Spring sample application
>
> Great example!!
>
> I'm totally agree that it should be on the documentation. Spring
> annotation
> configuration is like a fresh breath, I've worked on an app with thousands
> of spring xml configuration lines and it's like the hell, unfortunately
> annotation configuration is just supported by spring 2.5.
>
> On Thu, Mar 6, 2008 at 10:27 PM, James M Snell <ja...@gmail.com> wrote:
>
> >
> >
> > Remy Gendron wrote:
> > > Hello all,
> > >
> > > I have put together an Abdera server sample application that serves
> > movies,
> > > actors and roles (data taken from IMDB).
> > >
> > > The com.lacapitale.iex package is the glue code (or framework) part.
> The
> > > com.lacapitale.imdb is the example application.
> > >
> > > It demonstrates the following:
> > >
> >
> > Very cool.
> >
> > > [snip]
> > > This is a work in progress. No Javadoc yet. Any comments are welcome.
> > > I don't suggest providing a Spring integration with Abdera, the way to
> > do it
> > > depends to much on individual taste.
> >
> > I, unfortunately, do not know enough about Spring to decide one way or
> > the other.  However, perhaps there are ways of modifying the existing
> > spring code so that it is at least easier?
> >
> > > However, this could become part of the Wiki.
> > >
> >
> > Agreed. If you'd like to contribute it as an example, create a new jira
> > issue and I'll add the necessary information to the wiki.
> >
> > - James
> >
> > > You can get the project here: http://arrova.ca/files/imdb.rar
> > >
> > > Remy
> > >
> > > The dependencies are not included. Spring 2.5.1 was used. Here's my
> > > dependencies folder content:
> > >
> > > abdera-i18n-0.4.0-incubating-SNAPSHOT.jar
> > > abdera.client.0.4.0-incubating-SNAPSHOT.jar
> > > abdera.core.0.4.0-incubating-SNAPSHOT.jar
> > > abdera.parser.0.4.0-incubating-SNAPSHOT.jar
> > > abdera.protocol.0.4.0-incubating-SNAPSHOT.jar
> > > abdera.security.0.4.0-incubating-SNAPSHOT.jar
> > > abdera.server.0.4.0-incubating-SNAPSHOT.jar
> > > abdera.spring.0.4.0-incubating-SNAPSHOT.jar
> > > axiom-api-1.2.5.jar
> > > axiom-impl-1.2.5.jar
> > > bcprov-jdk15-137.jar
> > > commons-codec-1.3.jar
> > > commons-el.jar
> > > commons-httpclient-3.1.jar
> > > commons-logging-1.0.4.jar
> > > geronimo-activation_1.0.2_spec-1.1.jar
> > > geronimo-servlet_2.4_spec-1.0.jar
> > > hsqldb.jar
> > > htmlparser-1.0.5.jar
> > > jaxen-1.1.1.jar
> > > jdepend-2.9.jar
> > > jetty-6.1.3.jar
> > > jetty-util-6.1.3.jar
> > > json-1.0.jar
> > > junit-4.4.jar
> > > log4j-1.2.14.jar
> > > myfaces-api.jar
> > > myfaces-impl.jar
> > > ojdbc14.jar
> > > serializer.jar
> > > spring-test.jar
> > > spring.jar
> > > stax-api-1.0.1.jar
> > > tomahawk.jar
> > > wstx-asl-3.2.1.jar
> > > xmlsec-1.4.1.jar
> > > xpp3_min-1.1.4c.jar
> > > xstream-1.3.jar
> > >
> > >
> > >
> > >
> > > No virus found in this outgoing message.
> > > Checked by AVG Free Edition.
> > > Version: 7.5.516 / Virus Database: 269.21.6/1315 - Release Date:
> > 2008.03.06
> > > 09:07
> > >
> > >
> > >
> >
>
>
>
> --
> David Calavera
> http://www.thinkincode.net
>
> No virus found in this incoming message.
> Checked by AVG Free Edition.
> Version: 7.5.516 / Virus Database: 269.21.6/1315 - Release Date:
> 2008.03.06
> 09:07
>
>
> No virus found in this outgoing message.
> Checked by AVG Free Edition.
> Version: 7.5.516 / Virus Database: 269.21.6/1315 - Release Date:
> 2008.03.06
> 09:07
>
>
>


-- 
David Calavera
http://www.thinkincode.net

RE: Abdera / Spring sample application

Posted by Remy Gendron <re...@arrova.ca>.
Hello David,

I also much prefer the annotations over the XML configuration. Some will
tell you that annotations are bad because they introduce dependencies
between every one of your classes and the Spring framework, as you have to
import those annotations into the classes.

However, I find this argument weak as, if I write my app with Spring, I will
not go overboard to prevent dependencies on Spring. I don't need the option
of migrating my app to another light weight container.

Of course, I'm all in favour of good layering and decoupling where
appropriate and where the cost of it can or could be leveraged down the
road. This is exemplified by my usage of interfaces over my domain objects
instead of using true DTOs. My dependencies unit test also makes sure these
principles are enforced.

I haven't done any Ruby (yet) but I like the direction Abdera is taking by
favouring convention over configuration.

Keep up the good work! Thanks again... I look a lot smarter at work because
of you all!

Remy 

-----Original Message-----
From: David Calavera [mailto:david.calavera@gmail.com] 
Sent: March 06, 2008 17:07
To: abdera-user@incubator.apache.org
Subject: Re: Abdera / Spring sample application

Great example!!

I'm totally agree that it should be on the documentation. Spring annotation
configuration is like a fresh breath, I've worked on an app with thousands
of spring xml configuration lines and it's like the hell, unfortunately
annotation configuration is just supported by spring 2.5.

On Thu, Mar 6, 2008 at 10:27 PM, James M Snell <ja...@gmail.com> wrote:

>
>
> Remy Gendron wrote:
> > Hello all,
> >
> > I have put together an Abdera server sample application that serves
> movies,
> > actors and roles (data taken from IMDB).
> >
> > The com.lacapitale.iex package is the glue code (or framework) part. The
> > com.lacapitale.imdb is the example application.
> >
> > It demonstrates the following:
> >
>
> Very cool.
>
> > [snip]
> > This is a work in progress. No Javadoc yet. Any comments are welcome.
> > I don't suggest providing a Spring integration with Abdera, the way to
> do it
> > depends to much on individual taste.
>
> I, unfortunately, do not know enough about Spring to decide one way or
> the other.  However, perhaps there are ways of modifying the existing
> spring code so that it is at least easier?
>
> > However, this could become part of the Wiki.
> >
>
> Agreed. If you'd like to contribute it as an example, create a new jira
> issue and I'll add the necessary information to the wiki.
>
> - James
>
> > You can get the project here: http://arrova.ca/files/imdb.rar
> >
> > Remy
> >
> > The dependencies are not included. Spring 2.5.1 was used. Here's my
> > dependencies folder content:
> >
> > abdera-i18n-0.4.0-incubating-SNAPSHOT.jar
> > abdera.client.0.4.0-incubating-SNAPSHOT.jar
> > abdera.core.0.4.0-incubating-SNAPSHOT.jar
> > abdera.parser.0.4.0-incubating-SNAPSHOT.jar
> > abdera.protocol.0.4.0-incubating-SNAPSHOT.jar
> > abdera.security.0.4.0-incubating-SNAPSHOT.jar
> > abdera.server.0.4.0-incubating-SNAPSHOT.jar
> > abdera.spring.0.4.0-incubating-SNAPSHOT.jar
> > axiom-api-1.2.5.jar
> > axiom-impl-1.2.5.jar
> > bcprov-jdk15-137.jar
> > commons-codec-1.3.jar
> > commons-el.jar
> > commons-httpclient-3.1.jar
> > commons-logging-1.0.4.jar
> > geronimo-activation_1.0.2_spec-1.1.jar
> > geronimo-servlet_2.4_spec-1.0.jar
> > hsqldb.jar
> > htmlparser-1.0.5.jar
> > jaxen-1.1.1.jar
> > jdepend-2.9.jar
> > jetty-6.1.3.jar
> > jetty-util-6.1.3.jar
> > json-1.0.jar
> > junit-4.4.jar
> > log4j-1.2.14.jar
> > myfaces-api.jar
> > myfaces-impl.jar
> > ojdbc14.jar
> > serializer.jar
> > spring-test.jar
> > spring.jar
> > stax-api-1.0.1.jar
> > tomahawk.jar
> > wstx-asl-3.2.1.jar
> > xmlsec-1.4.1.jar
> > xpp3_min-1.1.4c.jar
> > xstream-1.3.jar
> >
> >
> >
> >
> > No virus found in this outgoing message.
> > Checked by AVG Free Edition.
> > Version: 7.5.516 / Virus Database: 269.21.6/1315 - Release Date:
> 2008.03.06
> > 09:07
> >
> >
> >
>



-- 
David Calavera
http://www.thinkincode.net

No virus found in this incoming message.
Checked by AVG Free Edition. 
Version: 7.5.516 / Virus Database: 269.21.6/1315 - Release Date: 2008.03.06
09:07
 

No virus found in this outgoing message.
Checked by AVG Free Edition. 
Version: 7.5.516 / Virus Database: 269.21.6/1315 - Release Date: 2008.03.06
09:07
 


Re: Abdera / Spring sample application

Posted by David Calavera <da...@gmail.com>.
Great example!!

I'm totally agree that it should be on the documentation. Spring annotation
configuration is like a fresh breath, I've worked on an app with thousands
of spring xml configuration lines and it's like the hell, unfortunately
annotation configuration is just supported by spring 2.5.

On Thu, Mar 6, 2008 at 10:27 PM, James M Snell <ja...@gmail.com> wrote:

>
>
> Remy Gendron wrote:
> > Hello all,
> >
> > I have put together an Abdera server sample application that serves
> movies,
> > actors and roles (data taken from IMDB).
> >
> > The com.lacapitale.iex package is the glue code (or framework) part. The
> > com.lacapitale.imdb is the example application.
> >
> > It demonstrates the following:
> >
>
> Very cool.
>
> > [snip]
> > This is a work in progress. No Javadoc yet. Any comments are welcome.
> > I don't suggest providing a Spring integration with Abdera, the way to
> do it
> > depends to much on individual taste.
>
> I, unfortunately, do not know enough about Spring to decide one way or
> the other.  However, perhaps there are ways of modifying the existing
> spring code so that it is at least easier?
>
> > However, this could become part of the Wiki.
> >
>
> Agreed. If you'd like to contribute it as an example, create a new jira
> issue and I'll add the necessary information to the wiki.
>
> - James
>
> > You can get the project here: http://arrova.ca/files/imdb.rar
> >
> > Remy
> >
> > The dependencies are not included. Spring 2.5.1 was used. Here's my
> > dependencies folder content:
> >
> > abdera-i18n-0.4.0-incubating-SNAPSHOT.jar
> > abdera.client.0.4.0-incubating-SNAPSHOT.jar
> > abdera.core.0.4.0-incubating-SNAPSHOT.jar
> > abdera.parser.0.4.0-incubating-SNAPSHOT.jar
> > abdera.protocol.0.4.0-incubating-SNAPSHOT.jar
> > abdera.security.0.4.0-incubating-SNAPSHOT.jar
> > abdera.server.0.4.0-incubating-SNAPSHOT.jar
> > abdera.spring.0.4.0-incubating-SNAPSHOT.jar
> > axiom-api-1.2.5.jar
> > axiom-impl-1.2.5.jar
> > bcprov-jdk15-137.jar
> > commons-codec-1.3.jar
> > commons-el.jar
> > commons-httpclient-3.1.jar
> > commons-logging-1.0.4.jar
> > geronimo-activation_1.0.2_spec-1.1.jar
> > geronimo-servlet_2.4_spec-1.0.jar
> > hsqldb.jar
> > htmlparser-1.0.5.jar
> > jaxen-1.1.1.jar
> > jdepend-2.9.jar
> > jetty-6.1.3.jar
> > jetty-util-6.1.3.jar
> > json-1.0.jar
> > junit-4.4.jar
> > log4j-1.2.14.jar
> > myfaces-api.jar
> > myfaces-impl.jar
> > ojdbc14.jar
> > serializer.jar
> > spring-test.jar
> > spring.jar
> > stax-api-1.0.1.jar
> > tomahawk.jar
> > wstx-asl-3.2.1.jar
> > xmlsec-1.4.1.jar
> > xpp3_min-1.1.4c.jar
> > xstream-1.3.jar
> >
> >
> >
> >
> > No virus found in this outgoing message.
> > Checked by AVG Free Edition.
> > Version: 7.5.516 / Virus Database: 269.21.6/1315 - Release Date:
> 2008.03.06
> > 09:07
> >
> >
> >
>



-- 
David Calavera
http://www.thinkincode.net

Re: Abdera / Spring sample application

Posted by James M Snell <ja...@gmail.com>.

Remy Gendron wrote:
> Hello all,
> 
> I have put together an Abdera server sample application that serves movies,
> actors and roles (data taken from IMDB).
> 
> The com.lacapitale.iex package is the glue code (or framework) part. The
> com.lacapitale.imdb is the example application.
> 
> It demonstrates the following:
> 

Very cool.

> [snip]
> This is a work in progress. No Javadoc yet. Any comments are welcome.
> I don't suggest providing a Spring integration with Abdera, the way to do it
> depends to much on individual taste.

I, unfortunately, do not know enough about Spring to decide one way or 
the other.  However, perhaps there are ways of modifying the existing 
spring code so that it is at least easier?

> However, this could become part of the Wiki.
> 

Agreed. If you'd like to contribute it as an example, create a new jira 
issue and I'll add the necessary information to the wiki.

- James

> You can get the project here: http://arrova.ca/files/imdb.rar
> 
> Remy
> 
> The dependencies are not included. Spring 2.5.1 was used. Here's my
> dependencies folder content:
> 
> abdera-i18n-0.4.0-incubating-SNAPSHOT.jar
> abdera.client.0.4.0-incubating-SNAPSHOT.jar
> abdera.core.0.4.0-incubating-SNAPSHOT.jar
> abdera.parser.0.4.0-incubating-SNAPSHOT.jar
> abdera.protocol.0.4.0-incubating-SNAPSHOT.jar
> abdera.security.0.4.0-incubating-SNAPSHOT.jar
> abdera.server.0.4.0-incubating-SNAPSHOT.jar
> abdera.spring.0.4.0-incubating-SNAPSHOT.jar
> axiom-api-1.2.5.jar
> axiom-impl-1.2.5.jar
> bcprov-jdk15-137.jar
> commons-codec-1.3.jar
> commons-el.jar
> commons-httpclient-3.1.jar
> commons-logging-1.0.4.jar
> geronimo-activation_1.0.2_spec-1.1.jar
> geronimo-servlet_2.4_spec-1.0.jar
> hsqldb.jar
> htmlparser-1.0.5.jar
> jaxen-1.1.1.jar
> jdepend-2.9.jar
> jetty-6.1.3.jar
> jetty-util-6.1.3.jar
> json-1.0.jar
> junit-4.4.jar
> log4j-1.2.14.jar
> myfaces-api.jar
> myfaces-impl.jar
> ojdbc14.jar
> serializer.jar
> spring-test.jar
> spring.jar
> stax-api-1.0.1.jar
> tomahawk.jar
> wstx-asl-3.2.1.jar
> xmlsec-1.4.1.jar
> xpp3_min-1.1.4c.jar
> xstream-1.3.jar
> 
> 
> 
> 
> No virus found in this outgoing message.
> Checked by AVG Free Edition. 
> Version: 7.5.516 / Virus Database: 269.21.6/1315 - Release Date: 2008.03.06
> 09:07
>  
> 
> 

Re: Abdera / Spring sample application

Posted by Dan Diephouse <da...@mulesource.com>.
Remy Gendron wrote:
> Hi Dan,
>
> Again, I agree with you, this code could be cleaned up and simplified if
> provided as an official demo. However, someone on the mailing list requested
> a few weeks ago an example Spring implementation and I wanted to make this
> available in its current, but unfinished state.
>   
Apologies if I was hopping on the "lets get this into the examples" 
train too soon. I agree its definitely great to have out there for users 
to look at.
> I'll port my code to the official 0.4.0 tag when it's out and thereafter
> I'll cleanup the demo for official inclusion in Abdera and the wiki.
>
>   
Cool :-)

Dan

-- 
Dan Diephouse
MuleSource
http://mulesource.com | http://netzooid.com 


RE: Abdera / Spring sample application

Posted by Remy Gendron <re...@arrova.ca>.
Hi Dan,

This example is part of an actual project here. This is why some classes are
there as place holders for more things to come.

I just didn't want to depend too much on the Abdera Spring package as at
first, I didn't knew too much where I was going. Moreover, I (maybe
mistakenly) thought that some refactoring would change this package after
the big 0.4.0 Abdera refactoring.

Service interface and ServiceBean are there as place holder as I will surely
be moving generic behaviors up into these classes as I move forward with my
real project.

Again, I agree with you, this code could be cleaned up and simplified if
provided as an official demo. However, someone on the mailing list requested
a few weeks ago an example Spring implementation and I wanted to make this
available in its current, but unfinished state.

But, using interfaces over domain objects goes a long way into preventing UI
developers from introducing BRs into the screens. I think we could leave
that part in the demo. And it aligns with Spring philosophy of coding to
interfaces.

HierarchicalDependencyConstraint is for used with the JDepend library in my
unit test. JDepend comes with a constraint class that can validate
dependencies. However, you have to explicitly list all of a class
dependencies to use it. I wanted to check generic layer dependencies such
as: the service layer cannot access the presentation layer, the presentation
layer must access the service layer thru the service api package only, the
presentation layer cannot access the persistence/dao layer directly.

I'll port my code to the official 0.4.0 tag when it's out and thereafter
I'll cleanup the demo for official inclusion in Abdera and the wiki.

R.



-----Original Message-----
From: Dan Diephouse [mailto:dan.diephouse@mulesource.com] 
Sent: March 06, 2008 20:18
To: abdera-dev@incubator.apache.org
Cc: abdera-user@incubator.apache.org
Subject: Re: Abdera / Spring sample application

Hi Remy,

Thanks for submitting this!

Some thoughts:

    * Couldn't you use the bundled SpringAbderaServlet? Other than the
      logging I don't see any functional differences.
    * I like that this goes from the frontend to the db
    * Are the Service/ServiceContext/ServiceBean clases necessary for
      the demo? It'd be nice to simplify things for a demo's sake.
      Granted you may introduce some tighter coupling by making Movie a
      concrete class instead of an interface and may not be able mock
      it, but at the same time we aren't trying to show the world those
      two things either :-) If I'm not wrong, this would allow some of
      the classes in the iex.rest package to go to.
    * It'd be nice if we could at least provide a parallel configuration
      which showed how to use the spring xml config support that we bundle.
    * What is HierarchicalDependencyConstraint for?

Dan

Remy Gendron wrote:
> Hello all,
>
> I have put together an Abdera server sample application that serves
movies,
> actors and roles (data taken from IMDB).
>
> The com.lacapitale.iex package is the glue code (or framework) part. The
> com.lacapitale.imdb is the example application.
>
> It demonstrates the following:
>
> * Application layering
>   * DAO
>   * Services
>   * Services APIs
>   * REST
> * Domain objects
>   * Domain objects used as DTOs
>   * Clients of the service layer only access the domain objects thru
> interfaces that restricts access to certain fields, thus preventing
business
> rules from being coded in the UI.
> * Spring integration:
>   * Auto discovery of adapters.
>   * Auto wiring of all dependencies.
>   * An example (ServiceContextBean) of a request scoped bean that
decouples
> the services layer from Abdera.
>   * Jdbc templates.
>   * MySQL DAOs to come later. DAO type selection would be done by a Spring
> auto discovery filter.
> * Abdera
>   * Automatic construction of the entry.content element thru reflection of
> the domain objects' implemented interfaces.
>   * Collection paging. 
> * Unit testing
>   * In memory HSQLDB.
>   * Jetty container.
>   * Base REST test class that starts HSQLDB, loads the test db scripts,
> starts Jetty/Spring/Abdera/IMDB.
>   * Base adapter test class that provides around 15 generic feed tests.
>   * Abstract DB unit test wrapper to load test data from sql scripts
(MySQL
> support to come).
>   * Unit tests for good application dependencies enforcement between the
> layers.
> * Misc
>   * Java configuration instead of XML or properties.
>
> This is a work in progress. No Javadoc yet. Any comments are welcome.
> I don't suggest providing a Spring integration with Abdera, the way to do
it
> depends to much on individual taste.
> However, this could become part of the Wiki.
>
> You can get the project here: http://arrova.ca/files/imdb.rar
>
> Remy
>
> The dependencies are not included. Spring 2.5.1 was used. Here's my
> dependencies folder content:
>
> abdera-i18n-0.4.0-incubating-SNAPSHOT.jar
> abdera.client.0.4.0-incubating-SNAPSHOT.jar
> abdera.core.0.4.0-incubating-SNAPSHOT.jar
> abdera.parser.0.4.0-incubating-SNAPSHOT.jar
> abdera.protocol.0.4.0-incubating-SNAPSHOT.jar
> abdera.security.0.4.0-incubating-SNAPSHOT.jar
> abdera.server.0.4.0-incubating-SNAPSHOT.jar
> abdera.spring.0.4.0-incubating-SNAPSHOT.jar
> axiom-api-1.2.5.jar
> axiom-impl-1.2.5.jar
> bcprov-jdk15-137.jar
> commons-codec-1.3.jar
> commons-el.jar
> commons-httpclient-3.1.jar
> commons-logging-1.0.4.jar
> geronimo-activation_1.0.2_spec-1.1.jar
> geronimo-servlet_2.4_spec-1.0.jar
> hsqldb.jar
> htmlparser-1.0.5.jar
> jaxen-1.1.1.jar
> jdepend-2.9.jar
> jetty-6.1.3.jar
> jetty-util-6.1.3.jar
> json-1.0.jar
> junit-4.4.jar
> log4j-1.2.14.jar
> myfaces-api.jar
> myfaces-impl.jar
> ojdbc14.jar
> serializer.jar
> spring-test.jar
> spring.jar
> stax-api-1.0.1.jar
> tomahawk.jar
> wstx-asl-3.2.1.jar
> xmlsec-1.4.1.jar
> xpp3_min-1.1.4c.jar
> xstream-1.3.jar
>
>
>
>
> No virus found in this outgoing message.
> Checked by AVG Free Edition. 
> Version: 7.5.516 / Virus Database: 269.21.6/1315 - Release Date:
2008.03.06
> 09:07
>  
>
>   


-- 
Dan Diephouse
MuleSource
http://mulesource.com | http://netzooid.com 

No virus found in this incoming message.
Checked by AVG Free Edition. 
Version: 7.5.516 / Virus Database: 269.21.6/1315 - Release Date: 2008.03.06
09:07
 

No virus found in this outgoing message.
Checked by AVG Free Edition. 
Version: 7.5.516 / Virus Database: 269.21.6/1317 - Release Date: 2008.03.07
08:15
 


Re: Abdera / Spring sample application

Posted by Dan Diephouse <da...@mulesource.com>.
Hi Remy,

Thanks for submitting this!

Some thoughts:

    * Couldn't you use the bundled SpringAbderaServlet? Other than the
      logging I don't see any functional differences.
    * I like that this goes from the frontend to the db
    * Are the Service/ServiceContext/ServiceBean clases necessary for
      the demo? It'd be nice to simplify things for a demo's sake.
      Granted you may introduce some tighter coupling by making Movie a
      concrete class instead of an interface and may not be able mock
      it, but at the same time we aren't trying to show the world those
      two things either :-) If I'm not wrong, this would allow some of
      the classes in the iex.rest package to go to.
    * It'd be nice if we could at least provide a parallel configuration
      which showed how to use the spring xml config support that we bundle.
    * What is HierarchicalDependencyConstraint for?

Dan

Remy Gendron wrote:
> Hello all,
>
> I have put together an Abdera server sample application that serves movies,
> actors and roles (data taken from IMDB).
>
> The com.lacapitale.iex package is the glue code (or framework) part. The
> com.lacapitale.imdb is the example application.
>
> It demonstrates the following:
>
> * Application layering
>   * DAO
>   * Services
>   * Services APIs
>   * REST
> * Domain objects
>   * Domain objects used as DTOs
>   * Clients of the service layer only access the domain objects thru
> interfaces that restricts access to certain fields, thus preventing business
> rules from being coded in the UI.
> * Spring integration:
>   * Auto discovery of adapters.
>   * Auto wiring of all dependencies.
>   * An example (ServiceContextBean) of a request scoped bean that decouples
> the services layer from Abdera.
>   * Jdbc templates.
>   * MySQL DAOs to come later. DAO type selection would be done by a Spring
> auto discovery filter.
> * Abdera
>   * Automatic construction of the entry.content element thru reflection of
> the domain objects' implemented interfaces.
>   * Collection paging. 
> * Unit testing
>   * In memory HSQLDB.
>   * Jetty container.
>   * Base REST test class that starts HSQLDB, loads the test db scripts,
> starts Jetty/Spring/Abdera/IMDB.
>   * Base adapter test class that provides around 15 generic feed tests.
>   * Abstract DB unit test wrapper to load test data from sql scripts (MySQL
> support to come).
>   * Unit tests for good application dependencies enforcement between the
> layers.
> * Misc
>   * Java configuration instead of XML or properties.
>
> This is a work in progress. No Javadoc yet. Any comments are welcome.
> I don't suggest providing a Spring integration with Abdera, the way to do it
> depends to much on individual taste.
> However, this could become part of the Wiki.
>
> You can get the project here: http://arrova.ca/files/imdb.rar
>
> Remy
>
> The dependencies are not included. Spring 2.5.1 was used. Here's my
> dependencies folder content:
>
> abdera-i18n-0.4.0-incubating-SNAPSHOT.jar
> abdera.client.0.4.0-incubating-SNAPSHOT.jar
> abdera.core.0.4.0-incubating-SNAPSHOT.jar
> abdera.parser.0.4.0-incubating-SNAPSHOT.jar
> abdera.protocol.0.4.0-incubating-SNAPSHOT.jar
> abdera.security.0.4.0-incubating-SNAPSHOT.jar
> abdera.server.0.4.0-incubating-SNAPSHOT.jar
> abdera.spring.0.4.0-incubating-SNAPSHOT.jar
> axiom-api-1.2.5.jar
> axiom-impl-1.2.5.jar
> bcprov-jdk15-137.jar
> commons-codec-1.3.jar
> commons-el.jar
> commons-httpclient-3.1.jar
> commons-logging-1.0.4.jar
> geronimo-activation_1.0.2_spec-1.1.jar
> geronimo-servlet_2.4_spec-1.0.jar
> hsqldb.jar
> htmlparser-1.0.5.jar
> jaxen-1.1.1.jar
> jdepend-2.9.jar
> jetty-6.1.3.jar
> jetty-util-6.1.3.jar
> json-1.0.jar
> junit-4.4.jar
> log4j-1.2.14.jar
> myfaces-api.jar
> myfaces-impl.jar
> ojdbc14.jar
> serializer.jar
> spring-test.jar
> spring.jar
> stax-api-1.0.1.jar
> tomahawk.jar
> wstx-asl-3.2.1.jar
> xmlsec-1.4.1.jar
> xpp3_min-1.1.4c.jar
> xstream-1.3.jar
>
>
>
>
> No virus found in this outgoing message.
> Checked by AVG Free Edition. 
> Version: 7.5.516 / Virus Database: 269.21.6/1315 - Release Date: 2008.03.06
> 09:07
>  
>
>   


-- 
Dan Diephouse
MuleSource
http://mulesource.com | http://netzooid.com 


Re: Abdera / Spring sample application

Posted by James M Snell <ja...@gmail.com>.

Remy Gendron wrote:
> Hello all,
> 
> I have put together an Abdera server sample application that serves movies,
> actors and roles (data taken from IMDB).
> 
> The com.lacapitale.iex package is the glue code (or framework) part. The
> com.lacapitale.imdb is the example application.
> 
> It demonstrates the following:
> 

Very cool.

> [snip]
> This is a work in progress. No Javadoc yet. Any comments are welcome.
> I don't suggest providing a Spring integration with Abdera, the way to do it
> depends to much on individual taste.

I, unfortunately, do not know enough about Spring to decide one way or 
the other.  However, perhaps there are ways of modifying the existing 
spring code so that it is at least easier?

> However, this could become part of the Wiki.
> 

Agreed. If you'd like to contribute it as an example, create a new jira 
issue and I'll add the necessary information to the wiki.

- James

> You can get the project here: http://arrova.ca/files/imdb.rar
> 
> Remy
> 
> The dependencies are not included. Spring 2.5.1 was used. Here's my
> dependencies folder content:
> 
> abdera-i18n-0.4.0-incubating-SNAPSHOT.jar
> abdera.client.0.4.0-incubating-SNAPSHOT.jar
> abdera.core.0.4.0-incubating-SNAPSHOT.jar
> abdera.parser.0.4.0-incubating-SNAPSHOT.jar
> abdera.protocol.0.4.0-incubating-SNAPSHOT.jar
> abdera.security.0.4.0-incubating-SNAPSHOT.jar
> abdera.server.0.4.0-incubating-SNAPSHOT.jar
> abdera.spring.0.4.0-incubating-SNAPSHOT.jar
> axiom-api-1.2.5.jar
> axiom-impl-1.2.5.jar
> bcprov-jdk15-137.jar
> commons-codec-1.3.jar
> commons-el.jar
> commons-httpclient-3.1.jar
> commons-logging-1.0.4.jar
> geronimo-activation_1.0.2_spec-1.1.jar
> geronimo-servlet_2.4_spec-1.0.jar
> hsqldb.jar
> htmlparser-1.0.5.jar
> jaxen-1.1.1.jar
> jdepend-2.9.jar
> jetty-6.1.3.jar
> jetty-util-6.1.3.jar
> json-1.0.jar
> junit-4.4.jar
> log4j-1.2.14.jar
> myfaces-api.jar
> myfaces-impl.jar
> ojdbc14.jar
> serializer.jar
> spring-test.jar
> spring.jar
> stax-api-1.0.1.jar
> tomahawk.jar
> wstx-asl-3.2.1.jar
> xmlsec-1.4.1.jar
> xpp3_min-1.1.4c.jar
> xstream-1.3.jar
> 
> 
> 
> 
> No virus found in this outgoing message.
> Checked by AVG Free Edition. 
> Version: 7.5.516 / Virus Database: 269.21.6/1315 - Release Date: 2008.03.06
> 09:07
>  
> 
> 

Re: Abdera / Spring sample application

Posted by Dan Diephouse <da...@mulesource.com>.
Hi Remy,

Thanks for submitting this!

Some thoughts:

    * Couldn't you use the bundled SpringAbderaServlet? Other than the
      logging I don't see any functional differences.
    * I like that this goes from the frontend to the db
    * Are the Service/ServiceContext/ServiceBean clases necessary for
      the demo? It'd be nice to simplify things for a demo's sake.
      Granted you may introduce some tighter coupling by making Movie a
      concrete class instead of an interface and may not be able mock
      it, but at the same time we aren't trying to show the world those
      two things either :-) If I'm not wrong, this would allow some of
      the classes in the iex.rest package to go to.
    * It'd be nice if we could at least provide a parallel configuration
      which showed how to use the spring xml config support that we bundle.
    * What is HierarchicalDependencyConstraint for?

Dan

Remy Gendron wrote:
> Hello all,
>
> I have put together an Abdera server sample application that serves movies,
> actors and roles (data taken from IMDB).
>
> The com.lacapitale.iex package is the glue code (or framework) part. The
> com.lacapitale.imdb is the example application.
>
> It demonstrates the following:
>
> * Application layering
>   * DAO
>   * Services
>   * Services APIs
>   * REST
> * Domain objects
>   * Domain objects used as DTOs
>   * Clients of the service layer only access the domain objects thru
> interfaces that restricts access to certain fields, thus preventing business
> rules from being coded in the UI.
> * Spring integration:
>   * Auto discovery of adapters.
>   * Auto wiring of all dependencies.
>   * An example (ServiceContextBean) of a request scoped bean that decouples
> the services layer from Abdera.
>   * Jdbc templates.
>   * MySQL DAOs to come later. DAO type selection would be done by a Spring
> auto discovery filter.
> * Abdera
>   * Automatic construction of the entry.content element thru reflection of
> the domain objects' implemented interfaces.
>   * Collection paging. 
> * Unit testing
>   * In memory HSQLDB.
>   * Jetty container.
>   * Base REST test class that starts HSQLDB, loads the test db scripts,
> starts Jetty/Spring/Abdera/IMDB.
>   * Base adapter test class that provides around 15 generic feed tests.
>   * Abstract DB unit test wrapper to load test data from sql scripts (MySQL
> support to come).
>   * Unit tests for good application dependencies enforcement between the
> layers.
> * Misc
>   * Java configuration instead of XML or properties.
>
> This is a work in progress. No Javadoc yet. Any comments are welcome.
> I don't suggest providing a Spring integration with Abdera, the way to do it
> depends to much on individual taste.
> However, this could become part of the Wiki.
>
> You can get the project here: http://arrova.ca/files/imdb.rar
>
> Remy
>
> The dependencies are not included. Spring 2.5.1 was used. Here's my
> dependencies folder content:
>
> abdera-i18n-0.4.0-incubating-SNAPSHOT.jar
> abdera.client.0.4.0-incubating-SNAPSHOT.jar
> abdera.core.0.4.0-incubating-SNAPSHOT.jar
> abdera.parser.0.4.0-incubating-SNAPSHOT.jar
> abdera.protocol.0.4.0-incubating-SNAPSHOT.jar
> abdera.security.0.4.0-incubating-SNAPSHOT.jar
> abdera.server.0.4.0-incubating-SNAPSHOT.jar
> abdera.spring.0.4.0-incubating-SNAPSHOT.jar
> axiom-api-1.2.5.jar
> axiom-impl-1.2.5.jar
> bcprov-jdk15-137.jar
> commons-codec-1.3.jar
> commons-el.jar
> commons-httpclient-3.1.jar
> commons-logging-1.0.4.jar
> geronimo-activation_1.0.2_spec-1.1.jar
> geronimo-servlet_2.4_spec-1.0.jar
> hsqldb.jar
> htmlparser-1.0.5.jar
> jaxen-1.1.1.jar
> jdepend-2.9.jar
> jetty-6.1.3.jar
> jetty-util-6.1.3.jar
> json-1.0.jar
> junit-4.4.jar
> log4j-1.2.14.jar
> myfaces-api.jar
> myfaces-impl.jar
> ojdbc14.jar
> serializer.jar
> spring-test.jar
> spring.jar
> stax-api-1.0.1.jar
> tomahawk.jar
> wstx-asl-3.2.1.jar
> xmlsec-1.4.1.jar
> xpp3_min-1.1.4c.jar
> xstream-1.3.jar
>
>
>
>
> No virus found in this outgoing message.
> Checked by AVG Free Edition. 
> Version: 7.5.516 / Virus Database: 269.21.6/1315 - Release Date: 2008.03.06
> 09:07
>  
>
>   


-- 
Dan Diephouse
MuleSource
http://mulesource.com | http://netzooid.com