<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
		>
<channel>
	<title>Comments on: Skrytý drahokam Springu</title>
	<atom:link href="http://blog.krecan.net/2009/01/22/skryty-drahokam-springu/feed/" rel="self" type="application/rss+xml" />
	<link>http://blog.krecan.net/2009/01/22/skryty-drahokam-springu/</link>
	<description>Short remarks from Java world</description>
	<lastBuildDate>Sat, 04 Feb 2012 09:44:38 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.2.1</generator>
	<item>
		<title>By: Petr Juza</title>
		<link>http://blog.krecan.net/2009/01/22/skryty-drahokam-springu/comment-page-1/#comment-848</link>
		<dc:creator>Petr Juza</dc:creator>
		<pubDate>Tue, 27 Jan 2009 12:59:14 +0000</pubDate>
		<guid isPermaLink="false">http://blog.krecan.net/?p=243#comment-848</guid>
		<description>Kromě @Configurable je ještě možné k podobným účelům použít ProxyFactory, ale to není vůbec tak hezké a hlavně to neřeší inicializaci objektů, kterou nemáme pod kontrolou, např. vytváření objektů Hibernatem.

Něco málo jsem o tom napsal &lt;a href=&quot;http://javicka.blogspot.com/2009/01/spring-aop-dynamic-proxies-vs-cglib.html&quot; rel=&quot;nofollow&quot;&gt;zde&lt;/a&gt;.</description>
		<content:encoded><![CDATA[<p>Kromě @Configurable je ještě možné k podobným účelům použít ProxyFactory, ale to není vůbec tak hezké a hlavně to neřeší inicializaci objektů, kterou nemáme pod kontrolou, např. vytváření objektů Hibernatem.</p>
<p>Něco málo jsem o tom napsal <a href="http://javicka.blogspot.com/2009/01/spring-aop-dynamic-proxies-vs-cglib.html" rel="nofollow">zde</a>.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Lukáš Křečan</title>
		<link>http://blog.krecan.net/2009/01/22/skryty-drahokam-springu/comment-page-1/#comment-847</link>
		<dc:creator>Lukáš Křečan</dc:creator>
		<pubDate>Mon, 26 Jan 2009 21:35:13 +0000</pubDate>
		<guid isPermaLink="false">http://blog.krecan.net/?p=243#comment-847</guid>
		<description>Dík za zkušenosti z praxe.</description>
		<content:encoded><![CDATA[<p>Dík za zkušenosti z praxe.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Lukas</title>
		<link>http://blog.krecan.net/2009/01/22/skryty-drahokam-springu/comment-page-1/#comment-846</link>
		<dc:creator>Lukas</dc:creator>
		<pubDate>Mon, 26 Jan 2009 13:00:17 +0000</pubDate>
		<guid isPermaLink="false">http://blog.krecan.net/?p=243#comment-846</guid>
		<description>Dagi, presne. Par dni jsem si s tim hral v prostredi, kde se pouziva maven.

Compile time weaving bylo nemozne nastavit v Eclipse rucne. Natoz donutit maven, aby pro kazde IDE generoval spravny konfigurak, ktery to zapne.

I Runtime weaving se musi nastavovat v IDE rucne, ale zaroven ho neni mozne mit v produkci, takze se musi delat 2 ruzne buldy.</description>
		<content:encoded><![CDATA[<p>Dagi, presne. Par dni jsem si s tim hral v prostredi, kde se pouziva maven.</p>
<p>Compile time weaving bylo nemozne nastavit v Eclipse rucne. Natoz donutit maven, aby pro kazde IDE generoval spravny konfigurak, ktery to zapne.</p>
<p>I Runtime weaving se musi nastavovat v IDE rucne, ale zaroven ho neni mozne mit v produkci, takze se musi delat 2 ruzne buldy.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Dagi</title>
		<link>http://blog.krecan.net/2009/01/22/skryty-drahokam-springu/comment-page-1/#comment-845</link>
		<dc:creator>Dagi</dc:creator>
		<pubDate>Mon, 26 Jan 2009 09:14:06 +0000</pubDate>
		<guid isPermaLink="false">http://blog.krecan.net/?p=243#comment-845</guid>
		<description>Bohuzel ten drahokam je tak skryty, ze z toho muze jednoho bolet hlava :-). Problem je v tom, ze pokud tam ten weaving neni, tak se uzivatel hrozne divi, ze se DI neprovede. Mozna vam to neprijde podstatne, ale nam se stalo, pri pouziti tehle techniky a lidi celkem matlo. Pustili si v IDE testy a hrozne se divili, ze to nefakci. No samozrejme by to fakcilo, kdyby vedeli, ze pro tu magii je potreba. Nerikam ze je to chyba technologie, ale...</description>
		<content:encoded><![CDATA[<p>Bohuzel ten drahokam je tak skryty, ze z toho muze jednoho bolet hlava <img src='http://blog.krecan.net/wp-includes/images/smilies/icon_smile.gif' alt=':-)' class='wp-smiley' /> . Problem je v tom, ze pokud tam ten weaving neni, tak se uzivatel hrozne divi, ze se DI neprovede. Mozna vam to neprijde podstatne, ale nam se stalo, pri pouziti tehle techniky a lidi celkem matlo. Pustili si v IDE testy a hrozne se divili, ze to nefakci. No samozrejme by to fakcilo, kdyby vedeli, ze pro tu magii je potreba. Nerikam ze je to chyba technologie, ale...</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Honza Novotný</title>
		<link>http://blog.krecan.net/2009/01/22/skryty-drahokam-springu/comment-page-1/#comment-843</link>
		<dc:creator>Honza Novotný</dc:creator>
		<pubDate>Sat, 24 Jan 2009 12:25:12 +0000</pubDate>
		<guid isPermaLink="false">http://blog.krecan.net/?p=243#comment-843</guid>
		<description>O jej, kdybych jen četl dokumentaci do konce .... :) :

&quot;6.8.1.2. Working with multiple application contexts

The AnnotationBeanConfigurerAspect used to implement the @Configurable support is an AspectJ singleton aspect. The scope of a singleton aspect is the same as the scope of static members, that is to say there is one aspect instance per classloader that defines the type. This means that if you define multiple application contexts within the same classloader hierarchy you need to consider where to define the  bean and where to place spring-aspects.jar on the classpath.

Consider a typical Spring web-app configuration with a shared parent application context defining common business services and everything needed to support them, and one child application context per servlet containing definitions particular to that servlet. All of these contexts will co-exist within the same classloader hierarchy, and so the AnnotationBeanConfigurerAspect can only hold a reference to one of them. In this case we recommend defining the  bean in the shared (parent) application context: this defines the services that you are likely to want to inject into domain objects. A consequence is that you cannot configure domain objects with references to beans defined in the child (servlet-specific) contexts using the @Configurable mechanism (probably not something you want to do anyway!).

When deploying multiple web-apps within the same container, ensure that each web-application loads the types in spring-aspects.jar using its own classloader (for example, by placing spring-aspects.jar in &#039;WEB-INF/lib&#039;). If spring-aspects.jar is only added to the container wide classpath (and hence loaded by the shared parent classloader), all web applications will share the same aspect instance which is probably not what you want.&quot;</description>
		<content:encoded><![CDATA[<p>O jej, kdybych jen četl dokumentaci do konce .... <img src='http://blog.krecan.net/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' />  :</p>
<p>"6.8.1.2. Working with multiple application contexts</p>
<p>The AnnotationBeanConfigurerAspect used to implement the @Configurable support is an AspectJ singleton aspect. The scope of a singleton aspect is the same as the scope of static members, that is to say there is one aspect instance per classloader that defines the type. This means that if you define multiple application contexts within the same classloader hierarchy you need to consider where to define the  bean and where to place spring-aspects.jar on the classpath.</p>
<p>Consider a typical Spring web-app configuration with a shared parent application context defining common business services and everything needed to support them, and one child application context per servlet containing definitions particular to that servlet. All of these contexts will co-exist within the same classloader hierarchy, and so the AnnotationBeanConfigurerAspect can only hold a reference to one of them. In this case we recommend defining the  bean in the shared (parent) application context: this defines the services that you are likely to want to inject into domain objects. A consequence is that you cannot configure domain objects with references to beans defined in the child (servlet-specific) contexts using the @Configurable mechanism (probably not something you want to do anyway!).</p>
<p>When deploying multiple web-apps within the same container, ensure that each web-application loads the types in spring-aspects.jar using its own classloader (for example, by placing spring-aspects.jar in 'WEB-INF/lib'). If spring-aspects.jar is only added to the container wide classpath (and hence loaded by the shared parent classloader), all web applications will share the same aspect instance which is probably not what you want."</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Honza Novotný</title>
		<link>http://blog.krecan.net/2009/01/22/skryty-drahokam-springu/comment-page-1/#comment-842</link>
		<dc:creator>Honza Novotný</dc:creator>
		<pubDate>Sat, 24 Jan 2009 12:21:25 +0000</pubDate>
		<guid isPermaLink="false">http://blog.krecan.net/?p=243#comment-842</guid>
		<description>Zdá se mi, že tahle technika asi nebude použitelná v případě, že v aplikaci běží víc aplikačních kontextů. Protože z ukázek není patrné, jak by bylo možné zvolit ten správný kontext, který mě například zajímá pro autowiring. Nebo je tu něco co jsem nepostřehl?

Na první pohled se mi tohle zdá jako fakt už velká magie. Kdybych studoval cizí kód který by něco takového používal a já o této možnosti nevěděl, tak jsem asi v koncích.</description>
		<content:encoded><![CDATA[<p>Zdá se mi, že tahle technika asi nebude použitelná v případě, že v aplikaci běží víc aplikačních kontextů. Protože z ukázek není patrné, jak by bylo možné zvolit ten správný kontext, který mě například zajímá pro autowiring. Nebo je tu něco co jsem nepostřehl?</p>
<p>Na první pohled se mi tohle zdá jako fakt už velká magie. Kdybych studoval cizí kód který by něco takového používal a já o této možnosti nevěděl, tak jsem asi v koncích.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Lukáš Křečan</title>
		<link>http://blog.krecan.net/2009/01/22/skryty-drahokam-springu/comment-page-1/#comment-841</link>
		<dc:creator>Lukáš Křečan</dc:creator>
		<pubDate>Sat, 24 Jan 2009 06:42:48 +0000</pubDate>
		<guid isPermaLink="false">http://blog.krecan.net/?p=243#comment-841</guid>
		<description>Ještě jsem o tom přemýšlel a napadly mě dvě věci.
1) @palo Máš pravdu, ono to ani jinak než staticky vyřešit nejde. Prostě je tam natvrdo vazba mezi třídou a konfigurací, ne mezi instancí a konfigurací. Varianta s AspectJ je jen mnohem lépe testovatelná než přímé volání statických metod.
2) Asi jsem špatně zvolil příklad, místo User.remove() tam mělo být User.leave() nebo User.die(), prostě něco co má smysl z obchodního hlediska, ne databázového.</description>
		<content:encoded><![CDATA[<p>Ještě jsem o tom přemýšlel a napadly mě dvě věci.<br />
1) @palo Máš pravdu, ono to ani jinak než staticky vyřešit nejde. Prostě je tam natvrdo vazba mezi třídou a konfigurací, ne mezi instancí a konfigurací. Varianta s AspectJ je jen mnohem lépe testovatelná než přímé volání statických metod.<br />
2) Asi jsem špatně zvolil příklad, místo User.remove() tam mělo být User.leave() nebo User.die(), prostě něco co má smysl z obchodního hlediska, ne databázového.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Lukáš Křečan</title>
		<link>http://blog.krecan.net/2009/01/22/skryty-drahokam-springu/comment-page-1/#comment-840</link>
		<dc:creator>Lukáš Křečan</dc:creator>
		<pubDate>Fri, 23 Jan 2009 17:10:28 +0000</pubDate>
		<guid isPermaLink="false">http://blog.krecan.net/?p=243#comment-840</guid>
		<description>Co se týče rychlosti při startu, předpokládám, že by to mohlo vyřešit přesunutí úprav bytecode do kompilace, popřípadě nějaký filtr, který omezí množství prohledávaných tříd.</description>
		<content:encoded><![CDATA[<p>Co se týče rychlosti při startu, předpokládám, že by to mohlo vyřešit přesunutí úprav bytecode do kompilace, popřípadě nějaký filtr, který omezí množství prohledávaných tříd.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: palo</title>
		<link>http://blog.krecan.net/2009/01/22/skryty-drahokam-springu/comment-page-1/#comment-839</link>
		<dc:creator>palo</dc:creator>
		<pubDate>Fri, 23 Jan 2009 12:13:38 +0000</pubDate>
		<guid isPermaLink="false">http://blog.krecan.net/?p=243#comment-839</guid>
		<description>@vlasta:
zkus si precist Domain Driven Design od Erica Evanse (je opravdu vyborna - http://domaindrivendesign.org/books/index.html#DDD) a/nebo dalsi zdroje na webu, napr. http://debasishg.blogspot.com/search/label/ddd a potom mozna zmenis nazor a nebude to fuj :o)</description>
		<content:encoded><![CDATA[<p>@vlasta:<br />
zkus si precist Domain Driven Design od Erica Evanse (je opravdu vyborna - <a href="http://domaindrivendesign.org/books/index.html#DDD" rel="nofollow">http://domaindrivendesign.org/books/index.html#DDD</a>) a/nebo dalsi zdroje na webu, napr. <a href="http://debasishg.blogspot.com/search/label/ddd" rel="nofollow">http://debasishg.blogspot.com/search/label/ddd</a> a potom mozna zmenis nazor a nebude to fuj <img src='http://blog.krecan.net/wp-includes/images/smilies/icon_surprised.gif' alt=':o' class='wp-smiley' /> )</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Vlasta</title>
		<link>http://blog.krecan.net/2009/01/22/skryty-drahokam-springu/comment-page-1/#comment-838</link>
		<dc:creator>Vlasta</dc:creator>
		<pubDate>Fri, 23 Jan 2009 10:33:44 +0000</pubDate>
		<guid isPermaLink="false">http://blog.krecan.net/?p=243#comment-838</guid>
		<description>Naucit objekty fukcionalitu napr persistovat je?

S tim nemohu souhlasit. To si pak kazdy muze volatu User.save() kdy a kde se mu to libi. Vedlo by to k rozdrobeni business logiky. Kdo nam zaruci, ze kdyz ma User ve svem ifacu metodu save(), ze bude vzdy spravne nasetovane DAO (nebo EntityManager).

Kdyz se tento pristup dovede ad absurdum tak by zadne servisni metody nebyly potreba...Fuj :)</description>
		<content:encoded><![CDATA[<p>Naucit objekty fukcionalitu napr persistovat je?</p>
<p>S tim nemohu souhlasit. To si pak kazdy muze volatu User.save() kdy a kde se mu to libi. Vedlo by to k rozdrobeni business logiky. Kdo nam zaruci, ze kdyz ma User ve svem ifacu metodu save(), ze bude vzdy spravne nasetovane DAO (nebo EntityManager).</p>
<p>Kdyz se tento pristup dovede ad absurdum tak by zadne servisni metody nebyly potreba...Fuj <img src='http://blog.krecan.net/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
]]></content:encoded>
	</item>
</channel>
</rss>

