如何选择适合的设计模式 [英] How to Choose a Design Pattern That Fits

查看:96
本文介绍了如何选择适合的设计模式的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在设计一个asp .net网站。如何选择符合我要求的设计模式? plz帮助这个

解决方案

好吧,首先阅读可用的设计模式及其在GoF中的用法 http://www.dofactory.com/Patterns/Patterns.aspx [ ^ ]。



然后重新访问您的应用程序要求并对用例模型进行基本设计。



然后在类图设计阶段,尝试对以下内容进行分组/分离(提供基本的编码实践,如DRY,Cohesiveness,松耦合) ,关注点分离等。)

1.用例中的共性[可以在之间共享]。

2.用例及其预期行为

3.使用的是第三方库吗?

4.使用的任何现有模块,但不是您的项目拥有?

5.您的应用程序可能连接的不同界面?

以及更多...



准备完所有上述列表后,您可以将它们映射回设计模式,看看哪一个最适合您。



干杯

- Balaji


嗯...没有太多信息可以提供建议。目前,只有您了解自己的要求。了解一些设计模式。从建筑设计模式开始。但首先,请尝试自己分析您的要求,以避免印记。



我现在所能做的就是指出一个很好的概括来源:

http://en.wikipedia.org/wiki/Architectural_pattern_(computer_science) [ ^ ],

< a href =http://en.wikipedia.org/wiki/Design_pattern_(computer_science)> http://en.wikipedia.org/wiki/Design_pattern_(computer_science) [ ^ ]。



-SA


我同意Balaji和SA,此外,我想说,可能如果你读过这本书会给你一个很好的解释不同的设计模式,



专业l ASP.NET设计模式

Scott Millett



希望有所帮助:)

I am designing a asp .net web site. How to Choose a Design Pattern That Fits to my requirement? plz help on this

解决方案

Well, first read through the available design patterns and their usage from GoF http://www.dofactory.com/Patterns/Patterns.aspx[^].

Then re-visit your application requirements and do the basic design on the use case model.

Then when it comes to the class diagram design phase, try to group/ separate the following (provided keeping in mind the basic Coding practices like DRY, Cohesiveness, loose coupling, separation of concern etc.)
1. Commonalities in the use cases [ that can be shared among].
2. Use cases and their expected behaviour
3. Any 3rd party libraries used?
4. Any existing modules being used, but not owned by your project?
5. Different interfaces that your application might be connected with?
and many more...

After you prepare a list of all the above, you can map them back to the design pattern to see which one best suits you.

Cheers
- Balaji


Hm… Not so much information to give an advice. For now, only you know your requirements. Learn some about design patterns. Start with architectural design patterns. But first, try to analyze your requirements by yourself, to avoid imprinting.

All I can do now is to point to a good source of most general overview:
http://en.wikipedia.org/wiki/Architectural_pattern_(computer_science)[^],
http://en.wikipedia.org/wiki/Design_pattern_(computer_science)[^].

—SA


I agree with Balaji and SA, in addition, I would like to say, probably if you read this book will give you a nice explanation about usage of different design patterns,

Professional ASP.NET Design Patterns
Scott Millett

Hope it helps :)


这篇关于如何选择适合的设计模式的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆