且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

OOP已死,AOP为未来而生(.net+java)

更新时间:2021-08-14 08:02:09

OOP已死,AOP为未来而生

 

未来用于构建复杂的基于服务的应用将是面向方面编程AOP(Aspect-Oriented Programming),而面向对象编程OOP将成为辅助。

 

•控制反转(IOC:Inversion of Control)模式。这个通用模式描述为支持插件架构,其中的对象可以“查询”,他们需要其他对象的实例方法。
•依赖注入(DI:Dependency Injection)模式。这是IoC模式一种特殊情况,是基于改变类行为的接口编程技术,而不改变类的内部。
开发人员针对为类的接口编码,并使用一个容器来注入依赖对象实例到基于接口或对象类型的类。
该技术注入对象实例包含接口注入,构造函数注入,属性(setter方法)注入和方法调用注入。

 

1. java IOC和DI模式应用:


Spring IoC container:
http://www.vogella.com/tutorials/SpringDependencyInjection/article.html
http://docs.spring.io/spring/docs/current/spring-framework-reference/html/beans.html
http://www.dzone.com/tutorials/java/spring/spring-ioc-1.html
Tapestry:https://tapestry.apache.org/ioc.html
PICO container:
http://picocontainer.codehaus.org/
http://docs.codehaus.org/display/PICO/Two+minute+tutorial
Google Guice:https://github.com/google/guice
SILK DI:http://www.silkdi.com/
Dagger:http://square.github.io/dagger/
CDI:http://docs.oracle.com/javaee/6/tutorial/doc/giwhl.html
Create a Simple IoC Container Using Annotations:https://today.java.net/article/2005/06/17/create-simple-ioc-container-using-annotations

 

2. .net IOC和DI模式应用:


Unity Application Block:https://msdn.microsoft.com/en-us/library/ff650806.aspx
Ninject:https://github.com/ninject