spring ref historydesign philosophy
生活随笔
收集整理的這篇文章主要介紹了
spring ref historydesign philosophy
小編覺得挺不錯的,現在分享給大家,幫大家做個參考.
spring中ref屬性與<ref/>標簽
在bean的內部引用另一個bean對象:
使用ref標簽對其進行引用: <ref bean="viewResolver2"/>
?
<bean id="viewResolver"class="org.springframework.web.servlet.view.InternalResourceViewResolver"><property name="prefix" value="/" /><property name="suffix" value=".jsp" /><property name="order" value="2"/> </bean> <bean class="org.springframework.web.servlet.view.ContentNegotiatingViewResolver"><property name="viewResolvers"><list><bean class="org.springframework.web.servlet.view.freemarker.FreeMarkerViewResolver"/> <!-- 引用外部id為viewResolver的bean --><ref bean="viewResolver"/></list></property> </bean>?
ref屬性:用來給一個對象的屬性設置值
使用<ref bean="viewResolver"/> bean id="sessionFactory" class="org.springframework.orm.hibernate3.LocalSessionFactoryBean"> <!-- 在spring框架加載時創建 --><bean id="borrowDao" class="dao.impl.BorrowDao" primary="true" lazy-init="true"><property name="sessionFactory" ref="sessionFactory"></property></bean>?
ref標簽:用來引用另一個bean:
<ref bean="viewResolver"/>,在spring容器中群釗id為viewResolver的bean對象
History
Spring最早在2003年,由于J2EE過于復雜而被開發出來的。有人認為Spring和Java EE是競爭關系,但Spring更像是對Java EE的補充。Spring整合了一些EE的標準:
- Servlet API
- WebSocket API
- Concurrency Utilities(并發性)
- JSON Binding API?簡介
- Bean Validation(數據校驗)?簡介
- JPA
- JMS
- Dependency Injection and Common Annotations
Java EE在app開發中的角色在隨時間變化。早期的時候,javaEE和Spring開發的應用是部署在application server上的,今天,在Spring Boot的幫助下開發變得友好且更加云端化(devops and cloud-friendly),嵌入Servelet容器,非常容易改變。在Spring Framework5中,一個webflux應用甚至不需要Servlet API并可以運行在不含Servlet容器的server上。
Spring projects目前在逐漸豐富,建立在Spring Framework上的projects有Spring Boot,Spring Security,Spring Data,Spring Cloud,Spring Batch…
Spring的design philosophy
- Provide choice at every level 盡可能允許不改動code的情況下變更design
- Accommodate diverse perspectives 允許設計的靈活性
- Maintain strong backward compatibility 對JDK和第三方庫的高兼容性
- Care about API design API被設計地簡單易用
- Set high standards for code quality 注意代碼的整潔
轉載于:https://www.cnblogs.com/zxzx1/p/10667984.html
總結
以上是生活随笔為你收集整理的spring ref historydesign philosophy的全部內容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: MySQL Connector / Py
- 下一篇: OpenGL绘制一个四边形