Spring学习总结(2)——Spring IOC的前世今生

时间:2021-06-09 16:55:44

前些天,参与了公司内部小组的一次技术交流,主要是针对《IOC与AOP》,本着学而时习之的态度及积极分享的精神,我就结合一个小故事来初浅地剖析一下我眼中的“IOC前世今生”,以方便初学者能更直观的来学习与理解IOC!也作抛砖引玉之用。

(虽说故事中的需求有点小,但看客可在脑海中尽量把他放大,想象成一个很大的应用系统)

一、IOC雏形

1、程序V1.0

话说,多年以前UT公司提出一个需求,要提供一个系统,其中有个功能可以在新春佳节之际给公司员工发送一封邮件。邮件中给大家以新春祝福,并告知发放一定数额的过节费。

经分析,决定由张三、李四和王五来负责此系统的开发。

其中:由张三负责业逻辑控制模块 LogicController的开发,此处简化为UT.LogicController.exe ;由李四负责祝福消息管理类(GreetMessageService),并集成到组件 UT.MessageService.dll中;由王五负责邮件功能帮助类(EmailHelper),并提供组件 UT.Email.dll。

类依赖关系如下:

aaarticlea/png;base64,iVBORw0KGgoAAAANSUhEUgAAAo0AAAEbCAYAAAC/er6OAAAACXBIWXMAAA7EAAAOxAGVKw4bAAAAB3RJTUUH3gkCAxEixwahqAAAAAd0RVh0QXV0aG9yAKmuzEgAAAAMdEVYdERlc2NyaXB0aW9uABMJISMAAAAKdEVYdENvcHlyaWdodACsD8w6AAAADnRFWHRDcmVhdGlvbiB0aW1lADX3DwkAAAAJdEVYdFNvZnR3YXJlAF1w/zoAAAALdEVYdERpc2NsYWltZXIAt8C0jwAAAAh0RVh0V2FybmluZwDAG+aHAAAAB3RFWHRTb3VyY2UA9f+D6wAAAAh0RVh0Q29tbWVudAD2zJa/AAAABnRFWHRUaXRsZQCo7tInAAAW40lEQVR4nO3db6gs530f8N/eeyW5EqGX1MhJhVqJ1Ao9s6RqYhS7JqbohRKHFlS4szc4L9K+CKH0RfvGb2rwzgr6poYSWqgd8sZQENydWyLa4lK9UEnT1OUSJybsHKM4RmrdCqrYyQVFiiVL2r6Y/Xd2Z8+zc3bP2fPn84ED954zO/PMzuyz333+bWc8Ho8D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49e7uvY+px8suLoE+HKC1+uFa/nY5LEhpjMnFhPrW+HkO3bhX4g0jOE1iWDxfWylred0PrZtvt4+hNnv4WgLn5+oLRPCtvV+fUsN10kdW8f/STbnq7LPr91fNdt1BtXdxh5OtmwzWN69nB+c23y2O42KJ5gn1vanY9q6rl+NSIyPpxZ77gW+M1mDnFc+BqeO7pz8ftT/96PP7Rp/ddlD1bXy+d3iL57evQM7frOiabLGnXW63XsuJOw1I8Ozw2EXGZQmNENC6XcsR0UOxJvmpwMrmjcd/1fpdnB7fdfvEmn263WbdkPlvWr1XAaFXGdWtbLn8v86bbReP6h9Pjrs7Sq2KQGHpQ9la/Hmrj81v60LG0k8Z7pvX13Vi+sExj++Ufsv5oTbmWgm+c5jnAVbDnpW1a1aH7sds6Jo87DYtt58Pm/ajfdq8zHjctDXq85194ZfZvy15wJmZL36wJpbMlH9Yv3M7Fp+65mFw3tjKt37NisuwZ29jm9XjJWhq59FbGRNZm38285u8AwHaERi6G6YzwpTUaj45rOa+zCAHg4hMauSAaxkQe+fMwxitrNQIAu3KpvkaQyy8fjqP1IFwALq6VrwRmX7Q0AgCQJDQCAJAkNAIAkCQ0AgCQJDQCAJAkNAIAkCQ0AgCQJDQCAJAkNAIAkCQ0AgCQJDQCAJAkNAIAkCQ0AgCQJDQCAJAkNAIAkCQ0AgCQJDQCAJAkNAIAkCQ0AgCQJDQCAJAkNAIAkCQ0AgCQJDQCAJAkNAIAkCQ0AgCQJDQCAJAkNAIAkCQ0AgCQJDQCAJB0Y9sdPP/CK7soBwBXgPcMuLhO1NL44A0NlABsxnsGXA4neiXf/syTuy4HwMZ+4ROP7bsItOA9A86fk9SjnfF4PD6FsgAAcInoMwAAIEloBAAgSWgEACBJaAQAIEloBAAgSWgEACBJaAQAIEloBAAgSWgEACBJaAQAIOn/Ay4AuDv4+QDaAAAAAElFTkSuQmCC" alt="" />

王五邮件功能模块核心代码如下:

public class EmailHelper
{
public void Send(string message)
{
Console.Write("Frome email: " + message);
}
}

李四消息管理模块核心代码如下

public class GreetMessageService
{
EmailHelper greetTool; public GreetMessageService()
{
greetTool = new EmailHelper();
} public void Greet(string message)
{
greetTool.Send(message);
}
}

张三业务集成模块核心代码如下:

string message = "新年快乐!过节费5000.";
MessageService.GreetMessageService service = new MessageService.GreetMessageService();
service.Greet(message);

三人经过一个月的艰苦奋战,终于大功告成,系统也在春节其间成功发出问候信。企业如此关怀,给员工带来无比的温暖,因此深受全体员工好评!

春节过后,相应的功能也移植到了与“UT公司”相关的“UT编辑部”和“UT房产”类似的应用当中,并在后继的“元宵”、“端午”、“中秋”等节日中得以广泛应用。

又是一个年关将至……

说真的,过节费的多少,有时可能直接影响整个假日的行程安排、从而影响假日的整体质量,因此部门领导高度重视。而邮件通知的方式,在边远山区常常因为受网 络环境的影响而无法正常收取,许多在外过年的同事对此颇有微词。后经多方考证,决得采用当下非常主流的电话语言播报的方式进行通知。

于是乎,张三、李四、王五又忙起来了。但李四,却有点头疼了,因为他的模块现在不仅在“UT公司”内部使用,而且还在“UT编辑部”和“UT房产”也都有独立运行。如何让此处变化影响最小,就得费点脑筋。为了达到较好的效果,李四决定按以下方式进行整改。

    ①、初始设计方案如下:

aaarticlea/png;base64,iVBORw0KGgoAAAANSUhEUgAAA0cAAAHxCAYAAACmtsfCAAAACXBIWXMAAA7EAAAOxAGVKw4bAAAAB3RJTUUH3gkCAxQEaHzQEAAAAAd0RVh0QXV0aG9yAKmuzEgAAAAMdEVYdERlc2NyaXB0aW9uABMJISMAAAAKdEVYdENvcHlyaWdodACsD8w6AAAADnRFWHRDcmVhdGlvbiB0aW1lADX3DwkAAAAJdEVYdFNvZnR3YXJlAF1w/zoAAAALdEVYdERpc2NsYWltZXIAt8C0jwAAAAh0RVh0V2FybmluZwDAG+aHAAAAB3RFWHRTb3VyY2UA9f+D6wAAAAh0RVh0Q29tbWVudAD2zJa/AAAABnRFWHRUaXRsZQCo7tInAAAgAElEQVR4nO3dW4xk930f+G/NRSOSoHcgk9SFYEhaF8J9Kj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gAACCJcAQAAJBEOAIAAEgiHAEAACQRjgAAAJIIRwAAAEmEIwAAgCTCEQAAQBLhCAAAIIlwBAAAkEQ4AgAASCIcAQAAJBGOAAAAkghHAAAASYQjAACAJMIRAABAEuEIAAAgiXAEAACQRDgCAABIIhwBAAAkEY4AAACSCEcAAABJhCMAAIAkwhEAAEAS4QgAACBJcqLqAoDD4czDT1RdAsAQn03AJLQcAVN70wkfIcDi8dkETMunBzC1sx+7u+oSgG1+8/23V11C5Xw2weI5KJ9NtW632626CAAAgKppOQIAAIhwBAAAkEQ4AgAASCIcAQAAJBGOAAAAkghHAAAASYQjAACAJMIRAABAEuEIAAAgSfJfAdAn2DX/cIpiAAAAAElFTkSuQmCC" alt="" />

首先为了能让不同“祝福方式”能有效替换,决定以“面向接口”的方式来进行分离。

同时,让EmailHelper的邮件通知类和TelephoneHelper的语音播报类都实现此接口。核心代码如下:

public interface ISendable
{
void Send(string message);
} public class EmailHelper : ISendable
{
public void Send(string message)
{
Console.Write("Frome email: " + message);
}
} public class TelephoneHelper : ISendable
{
public void Send(string message)
{
Console.Write("Frome telephone: " + message);
}
}

再者,为了方便兼容新旧产品,要求Controller决定当前采用什么方式进行通信,并以参数方式传给消息管理模块,核心代码如下:

public enum SendToolType
{
Email,
Telephone,
}

【备注】:上述代码,并不是一个优秀的设计,在后继的优化方案当中将被去除。

public class GreetMessageService
{
ISendable greetTool; public GreetMessageService(SendToolType sendToolType)
{
if (sendToolType == SendToolType.Email)
{
greetTool = new UT.EmailV20.EmailHelper();
}
else if (sendToolType == SendToolType.Telephone)
{
greetTool = new UT.TelephoneV20.TelephoneHelper();
}
} public void Greet(string message)
{
greetTool.Send(message);
}
}

【备注】:上述代码,并不是一个优秀的设计,在后继的优化方案当中将被优化。

最后,业务集成模块结合具体业务需求进行适当的调整,核心代码如下:

string message = "新年快乐!过节费5000.";
GreetMessageService service = new GreetMessageService(SendTool.Telephone);
service.Greet(message);

注:转载于:http://www.cnblogs.com/showjan/p/3950989.html还有更加详细的