简体   繁体   English

此SQL查询构建器UI的更好设计

[英]A better design of this SQL query builder UI

I'm in the process of redesigning a SQL query builder UI for a application that I use, well it's a third party app but has a plugin model so I writing my own to replace the standard one. 我正在为我使用的应用程序重新设计SQL查询生成器UI,这是第三方应用程序,但是具有插件模型,因此我编写了自己的插件来替换标准应用程序。 One area I am not very good at when it comes to application design is the UI. UI在应用程序设计方面我不是很擅长的领域之一是UI。

I would be really interested to see/hear how other people would layout this dialog, to make it a little bit better, or do you think that it is good as it is. 我真的很想知道/听到其他人如何布置此对话框,使其变得更好一点,或者您认为它是如此好。

I am using WPF for my new design so I can be pretty flexible with the UI. 我将WPF用于新设计,因此可以非常灵活地使用UI。

This is the current SQL UI: alt text http://img190.imageshack.us/img190/9492/sqlq.jpg 这是当前的SQL UI: 替代文本http://img190.imageshack.us/img190/9492/sqlq.jpg

Just for clarity when you select a option from the Tables menu, it adds the table name to the "from Tables" text box, same with the Columns drop down into "Select Columns" box. 为了清楚起见,当您从“表”菜单中选择一个选项时,它会将表名添加到“来自表”文本框中,与“列”下拉列表中的“选择列”框相同。

Who exactly would use such a UI? 到底谁会使用这种UI? Since it's basically just a pre-defined SELECT statement template, I would expect such a tool to be used by people who know how to write SQL statements from scratch (since that's essentially what they're doing). 由于它基本上只是一个预定义的SELECT语句模板,所以我希望知道如何从头开始编写SQL语句的人都可以使用这种工具(因为这实际上是他们的工作)。 The addition of available columns and tables and stuff like that is nice, I guess. 我想,增加可用的列和表之类的东西很好。

If the tool is meant to be used by experienced SQL users, the tool looks much too restrictive. 如果该工具供有经验的SQL用户使用,则该工具看起来过于严格。 For example, it appears that one would have to write his own JOIN clauses as WHERE clauses, making outer joins bothersome. 例如,似乎必须将自己的JOIN子句编写为WHERE子句,从而使外部联接麻烦。 It's much less useful than an open textbox. 它比打开的文本框有用得多。

If the tool is meant to be used by inexperienced users who might not know the ins and outs of relational database management systems, this thing is laughably awful. 如果该工具是供经验不足的用户使用的,他们可能不了解关系数据库管理系统的来龙去脉,那么这件事真可笑。 Too much needs to be done in spite of the restrictiveness of the tool. 尽管工具有局限性,但仍然需要做很多事情。 Too much knowledge of SQL is needed to understand what the form needs. 需要太多的SQL知识才能了解表单的需求。 It's more useful than an open textbox, but not much. 它比打开的文本框有用,但不多。

Ways to improve the tool depend on the end users. 改进工具的方法取决于最终用户。 If they're experienced with SQL, the tool should be more of an open textbox where they can write whatever they want, including JOINs. 如果他们有使用SQL的经验,那么该工具应该更多是一个开放的文本框,他们可以在其中编写所需的任何内容,包括JOIN。 Look at how Microsoft's Server Management Studio allows users to build queries: very nonrestrictive, with the ability to view tables and join them by dragging one column to another. 查看Microsoft的Server Management Studio如何允许用户构建查询:非限制性的,具有查看表并通过将一列拖到另一列来联接它们的能力。 That's a very natural way to approach queries in a visible, organized manner. 这是一种以自然,有组织的方式处理查询的自然方法。

If the users aren't experienced with SQL, the tool should do a lot more for them. 如果用户不熟悉SQL,则该工具应该为他们做更多的事情。 For example, if the user picks two tables, it should automatically join them so that he doesn't have to understand how joins work. 例如,如果用户选择两个表,它将自动将它们联接起来,这样他就不必了解联接的工作方式。 Also, the comboboxes on the side should be able to work in any of the open text boxes, not just one specific text box each. 另外,侧面的组合框应该能够在任何打开的文本框中使用,而不仅仅是每个特定的文本框中。 Because you need column names in the SELECT part as well as the WHERE part. 因为在SELECT部分​​和WHERE部分中都需要列名。

Just think about your userbase, and tailor to the tool to them. 只需考虑您的用户群,然后针对他们量身定制该工具即可。

A better UI would be to show all the tables, fields in a tree view with check boxes. 更好的UI是在带有复选框的树视图中显示所有表,字段。 Trapping the click-event, one can easily aggregate the SQL. 捕获点击事件,可以轻松聚合SQL。

Makes perfect sense if you know how to write SQL. 如果您知道如何编写SQL,则完全有道理。

I would consider perhaps moving the Tables-Columns-etc dropdownlists closer to where their contents will be displayed. 我可能会考虑将Tables-Columns-etc下拉列表移动到更接近其内容显示位置的位置。 You could even incorporate them with the left captions for the textboxes. 您甚至可以将它们与文本框的左标题合并在一起。 So, for example, where your text says "Select Columns", you could put the Columns dropdownlist in that spot. 因此,例如,如果您的文字显示为“选择列”,则可以将“列”下拉列表放在该位置。 Then the default selection there could be . 然后可能有默认选择。

I think it's a nice UI, though. 我认为这是一个不错的UI。

What about joins? 那加入呢?

What is the point of trying to redesign it? 尝试重新设计的目的是什么? Query analyser has one of the best UIs in that it is unobtrusive and lets you do what you need. 查询分析器具有最好的UI之一,它不引人注目,可让您执行所需的操作。

I think if you try and shoehorn statements into a format this will not always work but may work in the majority of cases. 我认为,如果您尝试将鞋拔子声明转换为某种格式,那么这种方法并不总是可行,但在大多数情况下都可以奏效。

It depends on the business requirements really. 这实际上取决于业务需求。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM