You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@directory.apache.org by Alex Karasulu <ak...@apache.org> on 2008/08/26 20:28:35 UTC
[ApacheDS] [XBeans] [Spring] Any issue with moving to spring 2.5?
Hi David,
Do you see any potential issue with moving to Spring 2.5.x WRT XBean? I was
thinking of upgrading but thought I'd check with you first.
Thanks,
Alex
Re: [ApacheDS] [XBeans] [Spring] Any issue with moving to spring 2.5?
Posted by Alex Karasulu <ak...@apache.org>.
Ahh that's great news. Thanks for for the support. Might need to take you
guys up on that.
Alex
On Tue, Aug 26, 2008 at 3:57 PM, Chris Custine <cc...@apache.org> wrote:
> Hi Alex,
> ServiceMix 3.3 (unreleased, currently in SVN trunk) uses Spring 2.5 and
> XBean together extensively so I think it should be safe to start down that
> path. I don't remember having any major difficulty in doing the upgrade (it
> was many months ago), but I believe the XBean dependency had to be brought
> up to a fairly recent release. I'd be happy to help if you have any issues.
>
> Chris
>
> --
> Chris Custine
> My Blog :: http://blog.organicelement.com
> Apache ServiceMix :: http://servicemix.apache.org
> Apache Directory Server :: http://directory.apache.org
>
>
>
> On Tue, Aug 26, 2008 at 1:07 PM, David Jencks <da...@yahoo.com>wrote:
>
>> Unfortunately I don't know how compatible spring 2.5 is with xbean-spring
>> and AFAIK no one has changed the documentation recently. I've heard rumors
>> that spring now has something sort of similar and almost as good as
>> xbean-spring so if true it might be worth switching.
>> If I was doing it over again I'd look into using jaxb rather than spring
>> but I don't know of any actual projects that have succeeded in doing
>> something like this.... it also might tie you to xml more than you like.
>>
>> Sorry I don't know more
>> david jencks
>>
>> On Aug 26, 2008, at 11:53 AM, Alex Karasulu wrote:
>>
>> Also Dave could you point me in the direction of some XBean
>> documentation. Last time I checked there was not much - hoping that some
>> might have been added since then. If not I guess I can look at test cases
>> to get a better understanding of how to use it.
>>
>> Thanks,
>> Alex
>>
>> On Tue, Aug 26, 2008 at 2:28 PM, Alex Karasulu <ak...@apache.org>wrote:
>>
>>> Hi David,
>>>
>>> Do you see any potential issue with moving to Spring 2.5.x WRT XBean? I
>>> was thinking of upgrading but thought I'd check with you first.
>>>
>>> Thanks,
>>> Alex
>>>
>>
>>
>>
>
Re: [ApacheDS] [XBeans] [Spring] Any issue with moving to spring 2.5?
Posted by Chris Custine <cc...@apache.org>.
Hi Alex,
ServiceMix 3.3 (unreleased, currently in SVN trunk) uses Spring 2.5 and
XBean together extensively so I think it should be safe to start down that
path. I don't remember having any major difficulty in doing the upgrade (it
was many months ago), but I believe the XBean dependency had to be brought
up to a fairly recent release. I'd be happy to help if you have any issues.
Chris
--
Chris Custine
My Blog :: http://blog.organicelement.com
Apache ServiceMix :: http://servicemix.apache.org
Apache Directory Server :: http://directory.apache.org
On Tue, Aug 26, 2008 at 1:07 PM, David Jencks <da...@yahoo.com>wrote:
> Unfortunately I don't know how compatible spring 2.5 is with xbean-spring
> and AFAIK no one has changed the documentation recently. I've heard rumors
> that spring now has something sort of similar and almost as good as
> xbean-spring so if true it might be worth switching.
> If I was doing it over again I'd look into using jaxb rather than spring
> but I don't know of any actual projects that have succeeded in doing
> something like this.... it also might tie you to xml more than you like.
>
> Sorry I don't know more
> david jencks
>
> On Aug 26, 2008, at 11:53 AM, Alex Karasulu wrote:
>
> Also Dave could you point me in the direction of some XBean documentation.
> Last time I checked there was not much - hoping that some might have been
> added since then. If not I guess I can look at test cases to get a better
> understanding of how to use it.
>
> Thanks,
> Alex
>
> On Tue, Aug 26, 2008 at 2:28 PM, Alex Karasulu <ak...@apache.org>wrote:
>
>> Hi David,
>>
>> Do you see any potential issue with moving to Spring 2.5.x WRT XBean? I
>> was thinking of upgrading but thought I'd check with you first.
>>
>> Thanks,
>> Alex
>>
>
>
>
Re: [ApacheDS] [XBeans] [Spring] Any issue with moving to spring 2.5?
Posted by Alex Karasulu <ak...@apache.org>.
On Tue, Aug 26, 2008 at 4:02 PM, Alex Karasulu <ak...@apache.org> wrote:
> Hi David,
>
> On Tue, Aug 26, 2008 at 3:07 PM, David Jencks <da...@yahoo.com>wrote:
>
>> Unfortunately I don't know how compatible spring 2.5 is with xbean-spring
>> and AFAIK no one has changed the documentation recently. I've heard rumors
>> that spring now has something sort of similar and almost as good as
>> xbean-spring so if true it might be worth switching.
>>
>
> Yeah I looked at the XML schema support but it seems more involved and
> invasive than using XBean since XBean uses Javadoc tags that do not require
> any additional dependencies on sources as opposed to using annotations.
>
>
>>
>> If I was doing it over again I'd look into using jaxb rather than spring
>> but I don't know of any actual projects that have succeeded in doing
>> something like this.... it also might tie you to xml more than you like.
>>
>
> Interesting. Well right now I'm trying not to make major decisions and
> just trying to upgrade to MINA 2.0. In doing this I noticed that some
> classes (which extend MINA classes) you created to make things work well
> with XBean are not broken because MINA has made their superior types final
> preventing extension.
>
errr ... meant to say are now broken.
>
>
> So I've looked back into the repository and found your old mina-xbean
> module and am trying to work that to create an XBean usable xsd for MINA.
> Perhaps this will help overcome some of the sticky issues with using simple
> Spring configuration. I noticed that XBean makes doing constructor
> injection and other things easier and clearer in general.
>
> So I'm just trying to do the minimum required to be able to migrate to 2.0
> but it's not easy for me being a Spring/Xbean novice. It's great to be able
> to bounce things off you - appreciate your comments. Thanks.
>
>
>>
>> Sorry I don't know more
>>
>
> No worries this is good information. Hope you don't mind my pinging you
> occasionally as I attempt to do this. Feeling pretty dumb already :).
>
> Thanks,
> Alex
>
> david jencks
>>
>> On Aug 26, 2008, at 11:53 AM, Alex Karasulu wrote:
>>
>> Also Dave could you point me in the direction of some XBean
>> documentation. Last time I checked there was not much - hoping that some
>> might have been added since then. If not I guess I can look at test cases
>> to get a better understanding of how to use it.
>>
>> Thanks,
>> Alex
>>
>> On Tue, Aug 26, 2008 at 2:28 PM, Alex Karasulu <ak...@apache.org>wrote:
>>
>>> Hi David,
>>>
>>> Do you see any potential issue with moving to Spring 2.5.x WRT XBean? I
>>> was thinking of upgrading but thought I'd check with you first.
>>>
>>> Thanks,
>>> Alex
>>>
>>
>>
>>
>
Re: [ApacheDS] [XBeans] [Spring] Any issue with moving to spring 2.5?
Posted by Alex Karasulu <ak...@apache.org>.
Hi David,
On Tue, Aug 26, 2008 at 3:07 PM, David Jencks <da...@yahoo.com>wrote:
> Unfortunately I don't know how compatible spring 2.5 is with xbean-spring
> and AFAIK no one has changed the documentation recently. I've heard rumors
> that spring now has something sort of similar and almost as good as
> xbean-spring so if true it might be worth switching.
>
Yeah I looked at the XML schema support but it seems more involved and
invasive than using XBean since XBean uses Javadoc tags that do not require
any additional dependencies on sources as opposed to using annotations.
>
> If I was doing it over again I'd look into using jaxb rather than spring
> but I don't know of any actual projects that have succeeded in doing
> something like this.... it also might tie you to xml more than you like.
>
Interesting. Well right now I'm trying not to make major decisions and just
trying to upgrade to MINA 2.0. In doing this I noticed that some classes
(which extend MINA classes) you created to make things work well with XBean
are not broken because MINA has made their superior types final preventing
extension.
So I've looked back into the repository and found your old mina-xbean module
and am trying to work that to create an XBean usable xsd for MINA. Perhaps
this will help overcome some of the sticky issues with using simple Spring
configuration. I noticed that XBean makes doing constructor injection and
other things easier and clearer in general.
So I'm just trying to do the minimum required to be able to migrate to 2.0
but it's not easy for me being a Spring/Xbean novice. It's great to be able
to bounce things off you - appreciate your comments. Thanks.
>
> Sorry I don't know more
>
No worries this is good information. Hope you don't mind my pinging you
occasionally as I attempt to do this. Feeling pretty dumb already :).
Thanks,
Alex
david jencks
>
> On Aug 26, 2008, at 11:53 AM, Alex Karasulu wrote:
>
> Also Dave could you point me in the direction of some XBean documentation.
> Last time I checked there was not much - hoping that some might have been
> added since then. If not I guess I can look at test cases to get a better
> understanding of how to use it.
>
> Thanks,
> Alex
>
> On Tue, Aug 26, 2008 at 2:28 PM, Alex Karasulu <ak...@apache.org>wrote:
>
>> Hi David,
>>
>> Do you see any potential issue with moving to Spring 2.5.x WRT XBean? I
>> was thinking of upgrading but thought I'd check with you first.
>>
>> Thanks,
>> Alex
>>
>
>
>
Re: [ApacheDS] [XBeans] [Spring] Any issue with moving to spring 2.5?
Posted by Alex Karasulu <ak...@apache.org>.
David, one more question:
If I have an inheritance hierarchy say Foo implementing Bar and Bar
interface has a destroy() method. How do I mark up the Javadocs so
Foo.destroy() is called as XBean DestroyMethod?
Thanks,
Alex
On Tue, Aug 26, 2008 at 3:07 PM, David Jencks <da...@yahoo.com>wrote:
> Unfortunately I don't know how compatible spring 2.5 is with xbean-spring
> and AFAIK no one has changed the documentation recently. I've heard rumors
> that spring now has something sort of similar and almost as good as
> xbean-spring so if true it might be worth switching.
> If I was doing it over again I'd look into using jaxb rather than spring
> but I don't know of any actual projects that have succeeded in doing
> something like this.... it also might tie you to xml more than you like.
>
> Sorry I don't know more
> david jencks
>
> On Aug 26, 2008, at 11:53 AM, Alex Karasulu wrote:
>
> Also Dave could you point me in the direction of some XBean documentation.
> Last time I checked there was not much - hoping that some might have been
> added since then. If not I guess I can look at test cases to get a better
> understanding of how to use it.
>
> Thanks,
> Alex
>
> On Tue, Aug 26, 2008 at 2:28 PM, Alex Karasulu <ak...@apache.org>wrote:
>
>> Hi David,
>>
>> Do you see any potential issue with moving to Spring 2.5.x WRT XBean? I
>> was thinking of upgrading but thought I'd check with you first.
>>
>> Thanks,
>> Alex
>>
>
>
>
Re: [ApacheDS] [XBeans] [Spring] Any issue with moving to spring 2.5?
Posted by David Jencks <da...@yahoo.com>.
Unfortunately I don't know how compatible spring 2.5 is with xbean-
spring and AFAIK no one has changed the documentation recently. I've
heard rumors that spring now has something sort of similar and almost
as good as xbean-spring so if true it might be worth switching.
If I was doing it over again I'd look into using jaxb rather than
spring but I don't know of any actual projects that have succeeded in
doing something like this.... it also might tie you to xml more than
you like.
Sorry I don't know more
david jencks
On Aug 26, 2008, at 11:53 AM, Alex Karasulu wrote:
> Also Dave could you point me in the direction of some XBean
> documentation. Last time I checked there was not much - hoping that
> some might have been added since then. If not I guess I can look at
> test cases to get a better understanding of how to use it.
>
> Thanks,
> Alex
>
> On Tue, Aug 26, 2008 at 2:28 PM, Alex Karasulu
> <ak...@apache.org> wrote:
> Hi David,
>
> Do you see any potential issue with moving to Spring 2.5.x WRT
> XBean? I was thinking of upgrading but thought I'd check with you
> first.
>
> Thanks,
> Alex
>
Re: [ApacheDS] [XBeans] [Spring] Any issue with moving to spring 2.5?
Posted by Alex Karasulu <ak...@apache.org>.
Also Dave could you point me in the direction of some XBean documentation.
Last time I checked there was not much - hoping that some might have been
added since then. If not I guess I can look at test cases to get a better
understanding of how to use it.
Thanks,
Alex
On Tue, Aug 26, 2008 at 2:28 PM, Alex Karasulu <ak...@apache.org> wrote:
> Hi David,
>
> Do you see any potential issue with moving to Spring 2.5.x WRT XBean? I was
> thinking of upgrading but thought I'd check with you first.
>
> Thanks,
> Alex
>
Re: Configure a partition without a context entry
Posted by Stefan Zoerner <st...@labeo.de>.
Hi Stefan!
Stefan Seelmann wrote:
> Isn't is possible to bundle an LDIF with the server and load that LDIF
> on startup automatically?
Of course, if you do that for the "dc=example,dc=com"-partition which is
pre-configured in the server.xml. But problems occur if a user wants to
define his/her own partition besides that. This is the more interesting
part ...
Greetings to Munich,
Stefan
Re: Configure a partition without a context entry
Posted by Stefan Seelmann <se...@apache.org>.
Stefan Zoerner wrote:
> Hi Alex!
>
> Alex Karasulu wrote:
>> Stefan Zoerner, your wish is my command:
>>
>> https://issues.apache.org/jira/browse/DIRSERVER-1237
>>
>> also ...
>>
>> http://svn.apache.org/viewvc?view=rev&revision=689396
>> <http://svn.apache.org/viewvc?view=rev&revision=689396>
>>
>> Take a look at the stock server.xml and let me know what you think.
>
> Thanks for implementing this that fast. I have tried it out, and it
> works. The problem now is that it is harder to get a new partition up
> and running for a user. But this is my fault :-)
Isn't is possible to bundle an LDIF with the server and load that LDIF
on startup automatically?
> It worked both with a "standard" command line tool and Directory Studio.
> But I would prefer to add a special command in Studio. "New entry..."
> does not work, if the suffix is built with more than one DN, like
> "dc=example,dc=com". And importing would mean that a user has to create
> a file.
>
> My favorite is to add a menu item in Studio which is called "New context
> entry ...". It should be only available on the "DIT" entry within the
> tree. Perhaps PAM or StefanS can help me to refine the requirement here ...
I remember that a user also need the ability to specify an complete DN
in the New Entry Wizard. But I don't find the mail nor a Jira about it.
Kind Regards,
Stefan
Configure a partition without a context entry (was: [ApacheDS] [XBeans]
[Spring] Any issue with moving to spring 2.5?)
Posted by Stefan Zoerner <st...@labeo.de>.
Hi Alex!
Alex Karasulu wrote:
> Stefan Zoerner, your wish is my command:
>
> https://issues.apache.org/jira/browse/DIRSERVER-1237
>
> also ...
>
> http://svn.apache.org/viewvc?view=rev&revision=689396
> <http://svn.apache.org/viewvc?view=rev&revision=689396>
>
> Take a look at the stock server.xml and let me know what you think.
Thanks for implementing this that fast. I have tried it out, and it
works. The problem now is that it is harder to get a new partition up
and running for a user. But this is my fault :-)
Anyway, I was able to do this by importing of a little LDIF which looked
like this:
dn: dc=example,dc=com
dc: example
objectClass: top
objectClass: domain
description: The context entry
It worked both with a "standard" command line tool and Directory Studio.
But I would prefer to add a special command in Studio. "New entry..."
does not work, if the suffix is built with more than one DN, like
"dc=example,dc=com". And importing would mean that a user has to create
a file.
My favorite is to add a menu item in Studio which is called "New context
entry ...". It should be only available on the "DIT" entry within the
tree. Perhaps PAM or StefanS can help me to refine the requirement here ...
But in general I think the new approach looks much clearer to me. I have
not understood what will happen to a partition definition within
server.xml, if I modify the LDIF after the first start. Will the entry
be modified after restart? I guess not ...
This confusion can't occur with the new approach.
More comments and suggestion on the file later. I would like to document
my new insights first ;-)
Greetings from Hamburg,
Stefan
Re: [ApacheDS] [XBeans] [Spring] Any issue with moving to spring 2.5?
Posted by Alex Karasulu <ak...@apache.org>.
Stefan Zoerner, your wish is my command:
https://issues.apache.org/jira/browse/DIRSERVER-1237
also ...
http://svn.apache.org/viewvc?view=rev&revision=689396
Take a look at the stock server.xml and let me know what you think.
http://svn.apache.org/viewvc/directory/apacheds/trunk/server-xml/src/main/resources/server.xml?view=markup&pathrev=689396
Wish I did this earlier. I'm sorry thinking how much hair this would have
saved Emmanuel which he was pulling out while getting the Spring
configuration working with these ContextEntries.
Emmanuel, we may have to cleanup a few things that we added just to make the
server.xml work with the ServerEntry for context entries. Do you remember
what kind of crazy code this made us have to put in to deal with the
registeries etc ? If you point it out I can go in and clean up.
Thanks,
Alex
On Tue, Aug 26, 2008 at 4:27 PM, Stefan Zoerner <st...@labeo.de> wrote:
> Hi all,
>
> regarding configuration with the server.xml file: The current solution is
> still not perfect; it simplifies the file a lot, but some things are really
> complicated to accomplish.
>
> I have started to documented it in the Basic User's Guide, but I stopped,
> because I still hope for some improvements before finalization in the 2.0
> Providing a context entry for instance is definitely not acceptable for our
> users.
>
> This is a fragment of the current style (perhaps I have missed something):
> ---
> <spring:bean id="systemContextEntry"
>
> class="org.springframework.beans.factory.config.MethodInvokingFactoryBean">
> <spring:property name="targetObject"><spring:ref
> local='directoryService'/></spring:property>
> <spring:property
> name="targetMethod"><spring:value>newEntry</spring:value></spring:property>
> <spring:property name="arguments">
> <spring:list>
> <spring:value xmlns="http://www.springframework.org/schema/beans">
> objectClass: top
> objectClass: organizationalUnit
> objectClass: extensibleObject
> ou: system
> </spring:value>
> <spring:value>ou=system</spring:value>
> </spring:list>
> </spring:property>
> </spring:bean>
>
> ---
>
> Note that also need a custom Editor for Attributes to be configured.
>
> Defining your own partition is at least hard with that. It is not possible
> to leave the context entry out, it won't work (NPE).
>
> Question: Is it possible to change the partition implementation that it
> works without providing an initial context entry in the configuration? In
> this case, the user has to add the "root entry" with a tool/LDIF load after
> starting the server with a new partition the first time, but this seems
> acceptable for me.
>
> The configuration would become much easier then.
>
> Another thing I was thinking about was creating our own namespace like
> described here:
>
>
> http://www.theserverside.com/tt/articles/article.tss?l=CustomNamespacesSpring2
>
> as an alternative to xbean. We would reduce the dependencies, although I
> agree that using xbean and its meta data in the javadoc is better than
> foreign annotations in our own sources.
>
> Greetings,
> Stefan
>
>
> Alex Karasulu wrote:
>
>> Hi David,
>>
>> Do you see any potential issue with moving to Spring 2.5.x WRT XBean? I
>> was thinking of upgrading but thought I'd check with you first.
>>
>> Thanks,
>> Alex
>>
>
>
>
Re: [ApacheDS] [XBeans] [Spring] Any issue with moving to spring
2.5?
Posted by Graham Leggett <mi...@sharp.fm>.
David Jencks wrote:
> Offhand I don't see why this is better than spring + xbean-spring, where
> you get an xsd generated from your classes that your server.xml plan can
> be validated against. Furthermore you don't have to write the code that
> translates from the xmlbeans objects to the runtime components, as
> spring does that part for you. Could you explain?
The requirements (in my mind anyway) are that it must be simple, it must
be difficult to get wrong, it must be simple to change, and errors must
be clear and simple enough to understand for a sleep deprived sysadmin
at 3am. In my experience, traditional XML based Spring fails on all
these counts.
At the core, if the user puts something syntactically invalid into their
config file, they must get a reasonable error message telling them
exactly what went wrong. Getting a general Spring error means nothing
whatsoever to an end user.
That's not to say that xbean-spring won't fit the bill, as long as it
fits the requirements above.
> However if anyone decides to go in this direction I think that using
> jaxb instead of xmlbeans, and more particularly sxc, is definitely the
> way to go. I think there's a good chance that it would be easy to make
> the runtime components actually be the jaxb objects.
From the sxc page at http://sxc.codehaus.org/JAXB:
"What is not implemented? [snip] Validation".
Lack of validation to me is a showstopper - if there is a syntax error
or omission in a config file, and the resulting error message is either
incomprehensible to the admin or (worse) it fails silently, then it
represents some serious breakage.
Regards,
Graham
--
Re: [ApacheDS] [XBeans] [Spring] Any issue with moving to spring 2.5?
Posted by David Jencks <da...@yahoo.com>.
On Aug 27, 2008, at 2:57 AM, Graham Leggett wrote:
> Emmanuel Lecharny wrote:
>
>> not only is this complex from the user POV, but from the developper
>> POV, this is a nightmare. I frankly don't like those annotations
>> stuff, plus the fact that the objects are instanciated during the
>> xml file processing is a real burden (and makes the configuration
>> file way too complex).
>> I will talk my mind : I think that going for Spring was a big
>> mistake.
>
> I have to agree at this point.
>
> My key experience with Spring is with debugging issues with it. On
> the last major project, virtually all issues that managed to slip
> past continuous integration were caused by mistakes in Spring files,
> which march straight past the compiler and in many cases past the
> unit tests and are found by the end user instead.
>
> The worst problem was a stray 'singleton="true"' that someone had
> put on a bean by accident through some careless cut and paste. It
> caused some financial reports to return subtly different data when
> the reports were repeated, and took over a month to find and fix.
> The end result was a whole host of assertions in the code entitled
> "dodgy stuff that Spring might do", and it aged us by years.
>
>> Now, what can we do ? I think that the way to go is to have the
>> configuration in the DIT, with LDIF based configuration files (like
>> OpenLdap has).
>
> What I have been doing with config files is defining the structure
> of the config files with an XSD, and then reading in the config file
> at the outset using xmlbeans autogenerated from the XSD.
>
> Like Spring, your config files are in an XML format, and like
> Spring, you end up with a set of Java beans that you can query to
> read your config, but unlike Spring, the format of the config file
> has a fixed structure validated against an XSD, and your code is
> validated by your compiler before it hits the end user.
>
> What this gives you is a (reasonably) sensible error message if the
> user makes a mistake in the config file, as you ask xmlbeans to
> validate the file when you read it in.
>
> In addition, making changes is a breeze: Change the XSD, regenerate
> the xmlbeans, wherever you have a compile error, that's where you
> need to change your code to support your new structure.
Offhand I don't see why this is better than spring + xbean-spring,
where you get an xsd generated from your classes that your server.xml
plan can be validated against. Furthermore you don't have to write
the code that translates from the xmlbeans objects to the runtime
components, as spring does that part for you. Could you explain?
However if anyone decides to go in this direction I think that using
jaxb instead of xmlbeans, and more particularly sxc, is definitely the
way to go. I think there's a good chance that it would be easy to
make the runtime components actually be the jaxb objects.
thanks
david jencks
>
>
> Regards,
> Graham
> --
Re: [ApacheDS] [XBeans] [Spring] Any issue with moving to spring
2.5?
Posted by Graham Leggett <mi...@sharp.fm>.
Emmanuel Lecharny wrote:
> not only is this complex from the user POV, but from the developper POV,
> this is a nightmare. I frankly don't like those annotations stuff, plus
> the fact that the objects are instanciated during the xml file
> processing is a real burden (and makes the configuration file way too
> complex).
>
> I will talk my mind : I think that going for Spring was a big mistake.
I have to agree at this point.
My key experience with Spring is with debugging issues with it. On the
last major project, virtually all issues that managed to slip past
continuous integration were caused by mistakes in Spring files, which
march straight past the compiler and in many cases past the unit tests
and are found by the end user instead.
The worst problem was a stray 'singleton="true"' that someone had put on
a bean by accident through some careless cut and paste. It caused some
financial reports to return subtly different data when the reports were
repeated, and took over a month to find and fix. The end result was a
whole host of assertions in the code entitled "dodgy stuff that Spring
might do", and it aged us by years.
> Now, what can we do ? I think that the way to go is to have the
> configuration in the DIT, with LDIF based configuration files (like
> OpenLdap has).
What I have been doing with config files is defining the structure of
the config files with an XSD, and then reading in the config file at the
outset using xmlbeans autogenerated from the XSD.
Like Spring, your config files are in an XML format, and like Spring,
you end up with a set of Java beans that you can query to read your
config, but unlike Spring, the format of the config file has a fixed
structure validated against an XSD, and your code is validated by your
compiler before it hits the end user.
What this gives you is a (reasonably) sensible error message if the user
makes a mistake in the config file, as you ask xmlbeans to validate the
file when you read it in.
In addition, making changes is a breeze: Change the XSD, regenerate the
xmlbeans, wherever you have a compile error, that's where you need to
change your code to support your new structure.
Regards,
Graham
--
Re: [ApacheDS] [XBeans] [Spring] Any issue with moving to spring 2.5?
Posted by Alex Karasulu <ak...@apache.org>.
On Tue, Aug 26, 2008 at 5:14 PM, Emmanuel Lecharny <el...@gmail.com>wrote:
> Hi Stefan,
>
> not only is this complex from the user POV, but from the developper POV,
> this is a nightmare. I frankly don't like those annotations stuff, plus the
> fact that the objects are instanciated during the xml file processing is a
> real burden (and makes the configuration file way too complex).
>
> I will talk my mind : I think that going for Spring was a big mistake.
>
Ditto.
>
> Now, what can we do ? I think that the way to go is to have the
> configuration in the DIT, with LDIF based configuration files (like OpenLdap
> has).
>
> The question is when will we have time to do that...
>
That's the big question. I can do it fast if I had a few things in my tool
chest like an LDAP persistence engine. But that in it self will take a
while to develop.
More inline on Stefan's comments ...
>
>
> Stefan Zoerner wrote:
>
>> Hi all,
>>
>> regarding configuration with the server.xml file: The current solution is
>> still not perfect; it simplifies the file a lot, but some things are really
>> complicated to accomplish.
>>
>> I have started to documented it in the Basic User's Guide, but I stopped,
>> because I still hope for some improvements before finalization in the 2.0
>> Providing a context entry for instance is definitely not acceptable for our
>> users.
>>
>> This is a fragment of the current style (perhaps I have missed something):
>> ---
>> <spring:bean id="systemContextEntry"
>>
>> class="org.springframework.beans.factory.config.MethodInvokingFactoryBean">
>>
>> <spring:property name="targetObject"><spring:ref
>> local='directoryService'/></spring:property>
>> <spring:property
>> name="targetMethod"><spring:value>newEntry</spring:value></spring:property>
>> <spring:property name="arguments">
>> <spring:list>
>> <spring:value xmlns="http://www.springframework.org/schema/beans">
>> objectClass: top
>> objectClass: organizationalUnit
>> objectClass: extensibleObject
>> ou: system
>> </spring:value>
>> <spring:value>ou=system</spring:value>
>> </spring:list>
>> </spring:property>
>> </spring:bean>
>>
>> ---
>>
>> Note that also need a custom Editor for Attributes to be configured.
>
>
This can be partially avoided with custom registrars in Spring but no need
to go into that. Still sucks to do.
>
>>
>> Defining your own partition is at least hard with that. It is not possible
>> to leave the context entry out, it won't work (NPE).
>>
>> Question: Is it possible to change the partition implementation that it
>> works without providing an initial context entry in the configuration? In
>> this case, the user has to add the "root entry" with a tool/LDIF load after
>> starting the server with a new partition the first time, but this seems
>> acceptable for me.
>>
>
Yeah we can do that or we can infer some minimal partition context entry
from the suffix. But I prefer your method since all sorts of complications
may emerge from "inferring" the minimal context entry.
>
>> The configuration would become much easier then.
>>
>
Yeah good point. This is what we should shoot for. We just need someone to
research that.
>
>> Another thing I was thinking about was creating our own namespace like
>> described here:
>>
>>
>> http://www.theserverside.com/tt/articles/article.tss?l=CustomNamespacesSpring2
>>
>> as an alternative to xbean. We would reduce the dependencies, although I
>> agree that using xbean and its meta data in the javadoc is better than
>> foreign annotations in our own sources.
>>
>
Yeah I'm thinking as long as we don't have CiDIT we might as well stick with
XBean Spring. We can always remove it for 3.0 which hopefully should not
take as long as 2.0 did.
I'd love to try to do CiDIT right away but we need some serious help. We
need at least 1-2 extra solid hands to accomplish this to be able to get a
2.0 out before the end of the year. I was hoping that GSoC student could
knock out a minimal persistence engine by now so we can race ahead and
replace XBean Spring with CiDIT but that never materialized.
Alex
Re: [ApacheDS] [XBeans] [Spring] Any issue with moving to spring
2.5?
Posted by Stefan Zoerner <st...@labeo.de>.
Emmanuel Lecharny wrote:
> I will talk my mind : I think that going for Spring was a big mistake.
I don't think so. Spring done right is a good thing.
> Now, what can we do ? I think that the way to go is to have the
> configuration in the DIT, with LDIF based configuration files (like
> OpenLdap has).
Perhaps later. I think the first step is to make it easier an a base we
already have. Alex improvements look good to me. Currently I build the
server and try them out.
More comments later.
Greetings,
Stefan
Re: [ApacheDS] [XBeans] [Spring] Any issue with moving to spring
2.5?
Posted by Emmanuel Lecharny <el...@gmail.com>.
Hi Stefan,
not only is this complex from the user POV, but from the developper POV,
this is a nightmare. I frankly don't like those annotations stuff, plus
the fact that the objects are instanciated during the xml file
processing is a real burden (and makes the configuration file way too
complex).
I will talk my mind : I think that going for Spring was a big mistake.
Now, what can we do ? I think that the way to go is to have the
configuration in the DIT, with LDIF based configuration files (like
OpenLdap has).
The question is when will we have time to do that...
Stefan Zoerner wrote:
> Hi all,
>
> regarding configuration with the server.xml file: The current solution
> is still not perfect; it simplifies the file a lot, but some things
> are really complicated to accomplish.
>
> I have started to documented it in the Basic User's Guide, but I
> stopped, because I still hope for some improvements before
> finalization in the 2.0 Providing a context entry for instance is
> definitely not acceptable for our users.
>
> This is a fragment of the current style (perhaps I have missed
> something):
> ---
> <spring:bean id="systemContextEntry"
> class="org.springframework.beans.factory.config.MethodInvokingFactoryBean">
>
> <spring:property name="targetObject"><spring:ref
> local='directoryService'/></spring:property>
> <spring:property
> name="targetMethod"><spring:value>newEntry</spring:value></spring:property>
>
> <spring:property name="arguments">
> <spring:list>
> <spring:value
> xmlns="http://www.springframework.org/schema/beans">
> objectClass: top
> objectClass: organizationalUnit
> objectClass: extensibleObject
> ou: system
> </spring:value>
> <spring:value>ou=system</spring:value>
> </spring:list>
> </spring:property>
> </spring:bean>
>
> ---
>
> Note that also need a custom Editor for Attributes to be configured.
>
> Defining your own partition is at least hard with that. It is not
> possible to leave the context entry out, it won't work (NPE).
>
> Question: Is it possible to change the partition implementation that
> it works without providing an initial context entry in the
> configuration? In this case, the user has to add the "root entry" with
> a tool/LDIF load after starting the server with a new partition the
> first time, but this seems acceptable for me.
>
> The configuration would become much easier then.
>
> Another thing I was thinking about was creating our own namespace like
> described here:
>
> http://www.theserverside.com/tt/articles/article.tss?l=CustomNamespacesSpring2
>
>
> as an alternative to xbean. We would reduce the dependencies, although
> I agree that using xbean and its meta data in the javadoc is better
> than foreign annotations in our own sources.
>
> Greetings,
> Stefan
>
> Alex Karasulu wrote:
>> Hi David,
>>
>> Do you see any potential issue with moving to Spring 2.5.x WRT XBean?
>> I was thinking of upgrading but thought I'd check with you first.
>>
>> Thanks,
>> Alex
>
>
>
--
--
cordialement, regards,
Emmanuel Lécharny
www.iktek.com
directory.apache.org
Re: [ApacheDS] [XBeans] [Spring] Any issue with moving to spring
2.5?
Posted by Stefan Zoerner <st...@labeo.de>.
Hi all,
regarding configuration with the server.xml file: The current solution
is still not perfect; it simplifies the file a lot, but some things are
really complicated to accomplish.
I have started to documented it in the Basic User's Guide, but I
stopped, because I still hope for some improvements before finalization
in the 2.0 Providing a context entry for instance is definitely not
acceptable for our users.
This is a fragment of the current style (perhaps I have missed something):
---
<spring:bean id="systemContextEntry"
class="org.springframework.beans.factory.config.MethodInvokingFactoryBean">
<spring:property name="targetObject"><spring:ref
local='directoryService'/></spring:property>
<spring:property
name="targetMethod"><spring:value>newEntry</spring:value></spring:property>
<spring:property name="arguments">
<spring:list>
<spring:value xmlns="http://www.springframework.org/schema/beans">
objectClass: top
objectClass: organizationalUnit
objectClass: extensibleObject
ou: system
</spring:value>
<spring:value>ou=system</spring:value>
</spring:list>
</spring:property>
</spring:bean>
---
Note that also need a custom Editor for Attributes to be configured.
Defining your own partition is at least hard with that. It is not
possible to leave the context entry out, it won't work (NPE).
Question: Is it possible to change the partition implementation that it
works without providing an initial context entry in the configuration?
In this case, the user has to add the "root entry" with a tool/LDIF load
after starting the server with a new partition the first time, but this
seems acceptable for me.
The configuration would become much easier then.
Another thing I was thinking about was creating our own namespace like
described here:
http://www.theserverside.com/tt/articles/article.tss?l=CustomNamespacesSpring2
as an alternative to xbean. We would reduce the dependencies, although I
agree that using xbean and its meta data in the javadoc is better than
foreign annotations in our own sources.
Greetings,
Stefan
Alex Karasulu wrote:
> Hi David,
>
> Do you see any potential issue with moving to Spring 2.5.x WRT XBean? I
> was thinking of upgrading but thought I'd check with you first.
>
> Thanks,
> Alex