|
From: Rod J. <rod...@in...> - 2004-04-06 19:21:19
|
The XmlBeanFactory and other such classes are largely preserved for backw=
ard
compatibility. Also, having a separation is important, but users shouldn'=
t
be *forced* to be aware of it.
----- Original Message -----
From: "Alef Arendsen" <al...@jt...>
To: <spr...@li...>
Sent: Monday, April 05, 2004 10:42 PM
Subject: RE: [Springframework-developer] Groovy / Jython (was: Road map)
What about the separation between BeanDefinitionReaders and BeanFactories=
? I
thought BeanDefinitionReaders were supposed to do the stuff specific to t=
he
format (say XML or properties) and BeanFactory is just the container. But
that's confusing because there still is a *Xml*BeanFactory out there.
J=FCrgen, what's your take on this? Is the XmlBeanFactory and XmlWebAppCt=
x
something ancient or does it still have its use?
Alef
> -----Original Message-----
> From: spr...@li...
> [mailto:spr...@li...] On Behal=
f
> Of Thomas Risberg
> Sent: Sunday, April 04, 2004 10:35 PM
> To: spr...@li...
> Subject: Re: [Springframework-developer] Groovy / Jython (was: Road map=
)
>
> I have bee experimenting a bit with Jython. I have not used it for a
> while, so I'm a bit rusty, but I did load an application context and
> used a data source been that was defined in it.
>
> I think that the different types of bean factories are going to have
> different feature sets - property files are less feature rich than the
> xml files. With jython and groovy, we will have similar issues where
> some features just does not fit naturally.
>
> Here is my context (applicationContext.py):
>
> from org.springframework.jdbc.datasource import DriverManagerDataSource
> from org.springframework.jdbc.core import JdbcTemplate
>
> dataSource =3D DriverManagerDataSource()
> dataSource.driverClassName=3D"org.hsqldb.jdbcDriver"
> dataSource.url=3D"jdbc:hsqldb:hsql://localhost"
> dataSource.username=3D"sa"
> dataSource.password=3D""
>
> db =3D JdbcTemplate(dataSource)
>
>
> Here is my code (LoadPyContext.java:
>
> import java.util.List;
>
> import org.python.core.PySystemState;
> import org.python.util.PythonInterpreter;
> import org.springframework.jdbc.core.JdbcTemplate;
>
> public class LoadPyContext {
> public static void main(String[] args) {
> System.out.println("Start");
> PySystemState.initialize();
> PythonInterpreter pyInterp =3D new PythonInterpreter();
> pyInterp.execfile("applicationContext.py");
> JdbcTemplate db =3D (JdbcTemplate) pyInterp.get("db",
> JdbcTemplate.class);
> List l =3D db.queryForList("select brand, price from beer");
> System.out.println(l);
> }
> }
>
> I guess the next step is to actually create a PythonBeanFactory.
>
> Thomas
>
> Alef Arendsen wrote:
>
> >Err,
> >
> >Been able to get a beanfactory up-and-running, however, not in a way a=
s
> >elegant as I wanted it to be, but that's something that's probably goi=
ng
> to
> >take some more time and thinking. It's something like this, and I don'=
t
> like
> >it ;-)
> >
> >test =3D new BeanDef (age:8,name:'susan')
> >test.singleton =3D true
> >test.dependencyCheck =3D PRIMITIVES
> >
> >est =3D new BeanDef (age:10)
> >est.name=3D'jim'
> >est.spouse=3Dtest
> >est.singleton =3D false
> >
> >I'm not entirely sure how to go about the dependencies and properties =
of
> a
> >bean versus the behavioral stuff (singleton, dependency checking,
> etcetera).
> >For sure we need some extra stuff here (i.e. some kind of wrapper arou=
nd
> the
> >BeanDefinition class--the BeanDef class in the script above), I don't
> think
> >dealing with MutablePropertyValue objects in a Groovy script directly =
is
> the
> >way to go. But maybe you noticed the problem in the script above alrea=
dy:
> >you can't have dependencies named 'singleton' or 'dependencyCheck' her=
e.
> So
> >maybe including some kind of metadata object might be an option.
> >
> >By the way, from my point of view, there's a difference between readin=
g
> in
> >and modifying a applicationcontext and its beandefinition and actually
> >approaching/using it at runtime. Currently I'm only thinking about the
> >former... Using it from Groovy scripts however could be quite somethin=
g
> as
> >well!
> >
> >Regards,
> >Alef
> >
> >
> >
> >
> >
> >
> >>-----Original Message-----
> >>From: spr...@li...
> >>[mailto:spr...@li...] On Beh=
alf
> >>Of Darren Davison
> >>Sent: Saturday, April 03, 2004 1:01 PM
> >>To: spr...@li...
> >>Subject: [Springframework-developer] Groovy / Jython (was: Road map)
> >>
> >>On Saturday 03 April 2004 09:47, Alef Arendsen wrote:
> >>
> >>
> >>
> >>>It would be nice to have something in the sandbox indeed. I'm curren=
tly
> >>>experimenting with a GroovyBeanDefinitionReader and it seems it's no=
t
> >>>going to be all that tough to get it running!
> >>>
> >>>
> >>snap!
> >>
> >>I started looking at something similar in both Groovy and Jython (par=
tly
> >>to
> >>see which of those two was 'best'). Thought it may be very useful fo=
r
> >>writing tests or certain deployment scripts.
> >>
> >>How far have you got with it?
> >>
> >>--
> >>
> >>Darren Davison
> >>Public Key: http://www.davison.uk.net/key.jsp
> >>
> >>
> >>-------------------------------------------------------
> >>This SF.Net email is sponsored by: IBM Linux Tutorials
> >>Free Linux tutorial presented by Daniel Robbins, President and CEO of
> >>GenToo technologies. Learn everything from fundamentals to system
> >>administration.http://ads.osdn.com/?ad_id=1470&alloc_id638&op=3Dclick
> >>_______________________________________________
> >>Springframework-developer mailing list
> >>Spr...@li...
> >>https://lists.sourceforge.net/lists/listinfo/springframework-develope=
r
> >>
> >>
> >
> >
> >
> >-------------------------------------------------------
> >This SF.Net email is sponsored by: IBM Linux Tutorials
> >Free Linux tutorial presented by Daniel Robbins, President and CEO of
> >GenToo technologies. Learn everything from fundamentals to system
> >administration.http://ads.osdn.com/?ad_id=1470&alloc_id638&op=3Dclick
> >_______________________________________________
> >Springframework-developer mailing list
> >Spr...@li...
> >https://lists.sourceforge.net/lists/listinfo/springframework-developer
> >
> >
> >
> >
> >
>
>
>
> -------------------------------------------------------
> This SF.Net email is sponsored by: IBM Linux Tutorials
> Free Linux tutorial presented by Daniel Robbins, President and CEO of
> GenToo technologies. Learn everything from fundamentals to system
> administration.http://ads.osdn.com/?ad_id=1470&alloc_id638&op=3Dclick
> _______________________________________________
> Springframework-developer mailing list
> Spr...@li...
> https://lists.sourceforge.net/lists/listinfo/springframework-developer
-------------------------------------------------------
This SF.Net email is sponsored by: IBM Linux Tutorials
Free Linux tutorial presented by Daniel Robbins, President and CEO of
GenToo technologies. Learn everything from fundamentals to system
administration.http://ads.osdn.com/?ad_id=1470&alloc_id638&op=3Dick
_______________________________________________
Springframework-developer mailing list
Spr...@li...
https://lists.sourceforge.net/lists/listinfo/springframework-developer
|