使用什么设计模式 [英] what design pattern to use

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

问题描述

必须创建一个多线程工具来比较两个excel文件..

单元格明智,公式化,格式化,颜色,宽度基于用户复选框选择。

我应该参考哪些设计方法/模式来构建一个强大的应用程序。





请建议

A multi threaded tool has to be created that compares two excel files..
Cell wise, Formula wise,formatting,colors,width based on users checkbox selections.
What could be the design approaches/patterns I should refer to build a robust application.


Please suggest

推荐答案

有一种设计模式可供使用:你的大脑。



请记住,设计模式不是目标的一部分。你需要从你的目标开始,真实的,而不是想象的目标,并且只是解决问题。假设您熟悉所有主要模式。如果,在你的路上,你可以看到一些模式可以帮助你,想想使用它,如果没有,忘记它。模式发布是为了在你有用的时候为你服务,而不是你为模式提供服务。



-SA
There is one design pattern to use: your brain.

Remember that design patterns are not the part of the goal. You need to start with your goals, real, not imaginary goals, and just work at the solution of the problem. Let's assume you are familiar with all major patterns. If, on you way, you can see that some pattern can help you, think at using it, if not, forget it. Patterns are published to serve you when it would be useful, not that you do your work to serve the patterns.

—SA


我一起使用Singleton,Strategy,设计模式的组合。



UI - 输入表格

Singleton object - 从UI获取数据并保存它。

保存对源Excel对象和目标Excel对象的引用



控制器类 - 启动基于用户输入的必要比较类



Excel对象 - 静默加载excel及其所有支持方法



抽象类 - 一种方法可以覆盖的Compare()和所有比较类型所需的其他常用方法。



从每种类型的Abstract类派生的具体类比较



然而实现多线程。欢迎改进/建议。
I used combination on Singleton, Strategy, design patterns together.

UI - Input form
Singleton object - Gets the data from UI and holds it.
Holds references to source Excel Object and target Excel object

Controller class - that initiates the necessary comparison class based on user Input

Excel Object - That loads the excel silently and all its supporting methods

Abstract Class - one method Compare() that can be overridden and other common methods needed for all comparison types.

Concrete classes derived from Abstract class for each type of comparison

Yet to implement multi threading. Improvements/Suggestions are welcome.


这篇关于使用什么设计模式的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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