|
马上注册,结交更多好友,享用更多功能,让你轻松玩转社区。
您需要 登录 才可以下载或查看,没有帐号?立即注册
x
但是我同意你的观点,对于大型项目来说,应该是采用框架的一部分,根据功能的不同而改进,欢迎你能再提出些宝贵意见,我会多多学习的。说到jbuilder,我可能是个人感觉,用的时候确实没有vs爽,我最喜欢的IDE是net网页编程beans,谢谢。
看到很多伴侣会商spring设置时以为spring设置中只能静态的设置一些参数(典范情形如数据库设置,准时器设置等)招致不便利,实在spring已供应了十分便当的体例来完成静态设置,我们要做的只是完成一个本人的FactoryBean,来看一下FactoryBean接口的界说
代码
/**
*InterfacetobeimplementedbyobjectsusedwithinaBeanFactory
*thatarethemselvesfactories.Ifabeanimplementsthisinterface,
*itisusedasafactory,notdirectlyasabean.
*
*<p><b>NB:Abeanthatimplementsthisinterfacecannotbeused
*asanormalbean.</b>AFactoryBeanisdefinedinabeanstyle,
*buttheobjectexposedforbeanreferencesisalwaystheobject
*thatitcreates.
*
*<p>FactoryBeanscansupportsingletonsandprototypes,andcan
*eithercreateobjectslazilyondemandoreagerlyonstartup.
*
*<p>Thisinterfaceisheavilyusedwithintheframework,for
*examplefortheAOPProxyFactoryBeanorJndiObjectFactoryBean.
*Itcanbeusedforapplicationcomponents,butthisisnotcommon
*outsideofinfrastructurecode.
*
*@authorRodJohnson
*@authorJuergenHoeller
*@since08.03.2003
*@seeorg.springframework.beans.factory.BeanFactory
*@seeorg.springframework.aop.framework.ProxyFactoryBean
*@seeorg.springframework.jndi.JndiObjectFactoryBean
*/
publicinterfaceFactoryBean{
/**
*Returnaninstance(possiblysharedorindependent)oftheobject
*managedbythisfactory.AswithaBeanFactory,thisallows
*supportforboththeSingletonandPrototypedesignpattern.
*<p>Ifthismethodreturns<code>null</code>,thefactorywillconsider
*theFactoryBeanasnotfullyinitializedandthrowacorresponding
*FactoryBeanNotInitializedException.
*@returnaninstanceofthebean(shouldnotbe<code>null</code>;
*a<code>null</code>valuewillbeconsideredasanindicationof
*incompleteinitialization)
*@throwsExceptionincaseofcreationerrors
*@seeFactoryBeanNotInitializedException
*/
ObjectgetObject()throwsException;
/**
*ReturnthetypeofobjectthatthisFactoryBeancreates,or<code>null</code>
*ifnotknowninadvance.Thisallowstocheckforspecifictypes
*ofbeanswithoutinstantiatingobjects,forexampleonautowiring.
*<p>Forasingleton,thisshouldtrytoavoidsingletoncreation
*asfaraspossible;itshouldratherestimatethetypeinadvance.
*Forprototypes,returningameaningfultypehereisadvisabletoo.
*<p>Thismethodcanbecalled<i>before</i>thisFactoryBeanhas
*beenfullyinitialized.Itmustnotrelyonstatecreatedduring
*initialization;ofcourse,itcanstillusesuchstateifavailable.
*<p><b>NOTE:</b>AutowiringwillsimplyignoreFactoryBeansthatreturn
*<code>null</code>here.Thereforeitishighlyrecommendedtoimplement
*thismethodproperly,usingthecurrentstateoftheFactoryBean.
*@returnthetypeofobjectthatthisFactoryBeancreates,
*or<code>null</code>ifnotknownatthetimeofthecall
*@seeListableBeanFactory#getBeansOfType
*/
ClassgetObjectType();
/**
*Isthebeanmanagedbythisfactoryasingletonoraprototype?
*Thatis,will<code>getObject()</code>alwaysreturnthesameobject
*(areferencethatcanbecached)?
*<p><b>NOTE:</b>IfaFactoryBeanindicatestoholdasingletonobject,
*theobjectreturnedfrom<code>getObject()</code>mightgetcached
*bytheowningBeanFactory.Hence,donotreturn<code>true</code>
*unlesstheFactoryBeanalwaysexposesthesamereference.
*<p>ThesingletonstatusoftheFactoryBeanitselfwillgenerally
*beprovidedbytheowningBeanFactory;usually,ithastobe
*definedassingletonthere.
*@returnifthisbeanisasingleton
*@see#getObject()
*/
booleanisSingleton();
}
<p>
唉!都是钱闹的1.Swing和.net网页编程开发比较------从市场份额看.net网页编程开发主要占据大部分的中小型和中型的的桌面开发,原因是它封装了很多工具 |
|