摘要
设计模式可以用来解决软件设计过程中反复出现的问题,因此具有一定的普遍性,同时与开发平台也是密切相关的。在不同的开发平台上,设计模式的实现方式往往会有很大的差别。在面向对象设计理论指导下,通过分析Visitor设计模式的优缺点,提出了在.Net平台下的改进方案。该方案降低了各个类之间的耦合度,使Visitor模式的使用更加简单灵活。对于文中每一种模式,都给出了UML类图和C#实现的代码片断。
The Design patterns are effective solutions to common problems in Software Design.So the Design Patterns have some certain universality and is closely connected with the Development Platform.The realization of the Design Pattern has a very big difference on the different Development Platform.In the light of the object-oriented design principles,by analyzing the advantages and shortcomings of the Visitor Design Pattern,an improved project is put forward on.NET Platform.The project reduces the degree of coupling of each class,and makes the Visitor Design Pattern easy and agile to use.The UML class diagrams and C# code fragments for each pattern are given.
出处
《微计算机信息》
2011年第9期219-221,共3页
Control & Automation
关键词
.NET
设计模式
反射技术
.NET
Design Patterns
Reflection technique