模块
Ruby中的类是表现事物的属性和行为,那么模块呢?,在Ruby中模块表现的只是事物的行为。
模块与类的区别于下:
- 模块不能拥有实例
- 模块不能被继承
如何访问模块内的方法?有两种方式可以访问
1.使用模块名.方法名的形式来直接调用模块中定义的方法。
1 | Math.sqrt(4) #=> 2.0 |
The HttpClient is library which is support by apache. It can post or get data from specific webservice and represents only the most basic contract for HTTP request execution.
We explain how to use this library with a example. In this example, we are going to use it to access the google tranlated API. Translating some text from specific language to other language. And this example using the Spring framework and Maven tool to build.
In this article, we introduce how to use AOP with the @AspectJ Annotation. If we want to use this Annotation. we should include below code in the XML schema-based configuration file.
1 | <aop:aspectj-autoproxy/> |
And also you need to add these libraries to your project, aspectjrt.jar, aspectjweaver.jar, aspectj.jar and aopalliance.jar.
Previously, we created AOP with Spring framework via implementing interface of spring AOP. And now we can use XML Schema to achieve it. We need to add below AspectJ libraries to our project. So downloading and adding them to the CLASSPATH of application, and also we can use the maven to build our application.