|
From: Alef A. <al...@jt...> - 2004-04-05 21:37:13
|
What about the separation between BeanDefinitionReaders and =
BeanFactories? I
thought BeanDefinitionReaders were supposed to do the stuff specific to =
the
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 =
XmlWebAppCtx
something ancient or does it still have its use?=20
Alef
> -----Original Message-----
> From: spr...@li...
> [mailto:spr...@li...] On =
Behalf
> Of Thomas Risberg
> Sent: Sunday, April 04, 2004 10:35 PM
> To: spr...@li...
> Subject: Re: [Springframework-developer] Groovy / Jython (was: Road =
map)
>=20
> 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.
>=20
> 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.
>=20
> Here is my context (applicationContext.py):
>=20
> from org.springframework.jdbc.datasource import =
DriverManagerDataSource
> from org.springframework.jdbc.core import JdbcTemplate
>=20
> dataSource =3D DriverManagerDataSource()
> dataSource.driverClassName=3D"org.hsqldb.jdbcDriver"
> dataSource.url=3D"jdbc:hsqldb:hsql://localhost"
> dataSource.username=3D"sa"
> dataSource.password=3D""
>=20
> db =3D JdbcTemplate(dataSource)
>=20
>=20
> Here is my code (LoadPyContext.java:
>=20
> import java.util.List;
>=20
> import org.python.core.PySystemState;
> import org.python.util.PythonInterpreter;
> import org.springframework.jdbc.core.JdbcTemplate;
>=20
> 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);
> }
> }
>=20
> I guess the next step is to actually create a PythonBeanFactory.
>=20
> Thomas
>=20
> Alef Arendsen wrote:
>=20
> >Err,
> >
> >Been able to get a beanfactory up-and-running, however, not in a way =
as
> >elegant as I wanted it to be, but that's something that's probably =
going
> 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 =
around
> 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 =
already:
> >you can't have dependencies named 'singleton' or 'dependencyCheck' =
here.
> 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 =
reading
> 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 =
something
> as
> >well!
> >
> >Regards,
> >Alef
> >
> >
> >
> >
> >
> >
> >>-----Original Message-----
> >>From: spr...@li...
> >>[mailto:spr...@li...] On =
Behalf
> >>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 =
currently
> >>>experimenting with a GroovyBeanDefinitionReader and it seems it's =
not
> >>>going to be all that tough to get it running!
> >>>
> >>>
> >>snap!
> >>
> >>I started looking at something similar in both Groovy and Jython =
(partly
> >>to
> >>see which of those two was 'best'). Thought it may be very useful =
for
> >>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-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
> >
> >
> >
> >
> >
>=20
>=20
>=20
> -------------------------------------------------------
> 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
|