ww1ww1
发贴: 202
|
于 2005-08-24 15:38
pro spring 第48页: Spring's Dependency Injection capabilities form the ideal solution to the external configuration of application components, not for dependency provision but as a mechanism for externalizing component configuration settings. The question here then is: What is the difference between a configuration parameter and any other kind of dependency? In most cases, you can clearly see whether a dependency should be classed as a configuration parameter, but if you are not sure, look for the following three characteristics that point to a configuration parameter:。。。
想想怎么spring也管起了implements是有必要在interface上定义这事啦。感觉pro spring 话挺多的。
第49页 it is obvious that all implementations need to know which SMTP server to use when sending e-mails.However, we would probably choose to leave the configuration option that flags whether to send secure e-mail off the business interface, because not all e-mail APIs are capable of this and it is correct to assume that many implementations will not take security into consideration at all.
这个当然啦,如果implements不是大多数实现类都需要实现的方法,当然不用在interface定义啦。。。无语了,感觉在教我怎么写interface而不是spring了。还挺厉害的,一共罗列了3条标准。。。这。。。
|