应用设计问题

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

问题描述




这实际上不是C#问题,但由于这是唯一的新闻组,我跟随我决定

在这里发布我的问题(请告诉我下次在哪里发帖如果你这个帖子不应该在这里
)。


我有两个设计问题:

1.如果您计划
$ b $,将数据库查询包含在

代码中的正确(或最佳)方式是什么? b支持多个数据库。假设我有一个应用程序,它将支持SQL Server 2000和Oracle(甚至可能是其他一些数据库)。

我将在哪里存储这些查询(那里)整个应用程序中可能有很多它们?b $ b整个应用程序)?查询可能很简单,复杂,有

参数,INSERT,UPDATE,DELETE语句....你得到的图片:)


2.如何设计具有可扩展用户界面的应用程序?这是一个

可能的场景:

我申请了3个人。过了一会儿,人们真的很满意这个应用程序,并且想要升级并添加一个简单的文本

框(升级也可能需要另一个字段)数据库)但

其他

2个客户不想要那个文本框。相反,这2个客户中的一个在表单上需要2

不同的字段。

如何设计应用程序从一开始就准备好这些
$ b未来$ b种变化?

对于一个简单的应用程序,我可以制作不同的应用程序副本

但即使这个简单的例子我也会

有3个不同的应用程序 - 所以这个解决方案听起来真的很糟糕,并且几个月内可能会变成维持噩梦。

我也可以这样:

if(client ==" client1"){//显示此文本框};

但是再次看起来并不是很好 - 这会导致很多在
代码中的ifs。


有什么想法吗?


谢谢,

saso



this is not actually a C# problem but since this is the only newsgroup I
follow I decided
to post my question here (please tell me where to post this next time if you
think this post shouldn''t be here).

I have two design questions:
1. what is the correct (or best) way to include database queries into the
code if you plan on
supporting multiple databases. Let''s say I have an application that will
support SQL server 2000 and Oracle (and maybe even some other database).
Where would I store these queries (there could be a LOT of them throughout
the entire application)? The queries could be simple, complex, with
parameters, INSERT, UPDATE, DELETE statements.... you get the picture :)

2. How to design an application with an extendable user interface? Here is a
possible scenario:
I make an application for 3 people. After a while, one is really happy with
the application and would like to have an upgrade and add just a simple text
box (the upgrade could also require another field in the database) but the
other
2 clients don''t want that textbox. Instead, one of those 2 clients wants 2
different fields on the form.
How to design the application from the beginning to be prepared for these
kinds of changes in the future?
For a simple application I could make different copies of the application
but even for this simple example I would
have 3 different applications - so this solution sound REALLY bad and would
probably turn into a maintainance nightmare in a few months.
I could also have this:
if ( client == "client1") { // show this textbox };
but again this doesn''t seems very good - it would lead to a lot of ifs in
the code.

Any ideas?

thanks,
saso

推荐答案








这篇关于应用设计问题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

09-13 10:31
查看更多