如何知道选择哪种软件设计模式? [英] how to know which software design pattern to choose ?

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

问题描述

大家好

经过数小时的阅读,我仍然不确定要为我的项目实施哪种软件设计模式.

我必须设计一个kios系统来订购备件,该备件具有另一个父备件系统的一些功能.

我需要使用一种软件模式来实现该kios系统,到目前为止,我只限于工厂模式.但是,我仍然不知道如何在实际项目中实现它.

我是否可以知道是否有其他实施指南,或者是否有适当的模式来解决我的问题?

问候
Mel

Hi all

After countless of hours of reading, i am still not sure which software design pattern to choose from to implement for my project.

i must design a kios system to order spare parts which has a few functionality of another parent spare part system.

i need to use a software pattern to implement this kios system and so far, i have only narrowed to factory pattern. However, i still have no idea on how to implement it in actual project.

May i know if there''s any other guide on how to implement it or is there any appropriate pattern to address my problem ?

Regards
Mel

推荐答案

选择完成任务的一个,或者根本不选择一个.我从来没有自觉地决定使用特定的设计模式".我做对项目有意义的事情,并继续我的生活.我通常会尽可能地将接口与其他所有接口分离开来,然后再使用它.如果有数据库方面的内容,我会将其与其他所有内容"分开.我可以相对轻松地在平台之间移动,而这才是最重要的-改变方向时的敏捷性-发生的次数比实际情况多得多.
Pick the one that gets the job done, or don''t pick one at all. I''ve never consciously made a decision to use a specific "design pattern". I do what makes sense for the project, and get on with my life. I usually split the interface as much as possible from everything else, and go with it. If there is a database aspect, I separate that from the "everything else". I can move between platforms with relative ease that way, and that''s all that counts - agility when changing direction - which happens a lot more than it really should.


您好,

目前,我正在阅读有关designpatterns的书,该书写得很好,并且很好理解很多有趣的实际示例.
Hi,

currently i am reading a book over designpatterns it is well written and good to understand with lots of funny practical examples.
http://books.google.de/books?id=GGpXN9SMELMC&printsec=frontcover&dq=Head+First+Design+Patterns&hl=de&ei=-xSPTeaEOcj4sgbvvMmXCg&sa=X&oi=book_result&ct=result&resnum=1&ved=0CDMQ6AEwAA#v=onepage&q&f=false[^]


Based on your question you can not say i implement a compelte Program with the pattern x or y. Patterns are paths to find a solution for small individual problems. Not for a complete Software.

You have to split your complete Program to small problems and than you can ask with which patterns I could solve this small probelm.

Hope it helps.


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

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