在数据库上存储业务逻辑,控件属性,数据验证 [英] Storage of business logic, control properties, data validation on database

查看:108
本文介绍了在数据库上存储业务逻辑,控件属性,数据验证的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个数据输入Web应用程序,它充当控制管理器,确定要调用哪些其他Web表单.通常,对于其他一些应用程序,这些是不同的数据输入Web表单.

我想将现有的业务逻辑从后端C#代码转移到数据库(Oracle)中的存储过程.另外,我还想将控件的属性(即文本框,标签)(即x坐标,y坐标,宽度,高度)存储在数据库中,以便在运行时将其绘制到Webform 基于用户的选择.例如,如果用户选择产品" ,则将打印与产品信息有关的控件集.如果用户选择"Employee" ,则将绘制与Employee相关的控件集.

我预见到一些问题,例如在每个回发中重新绘制控件,招致额外的数据库调用以检索控件的属性,Web服务器中控件的状态缓存(如果存在多个控件和用户的话)可能很大. />
这种方法是否有更好的设计?赞赏一些意见.谢谢.

I have a data entry web application that acts as a control manager deciding which other webforms to invoke. Typically, these are different data entry webforms for some other applications.

I would like to shift the existing business logic from backend C# code to stored procedures in database (Oracle). Additionally, I would also like to store the controls''(ie textbox, label) properties (ie x-coordinate, y-coordinate, width, height) in the database such that they are painted on run-time on to the webform based on users selection . For example, if a user selects "Product" then the set of controls relating to Product information is printed. If user selects "Employee" then set of controls relating to Employee is painted.

I forsee some problems such as re-painting of controls on each postback, incurring addtional database calls to retrieve the controls'' properties, caching of controls'' state in web server would potentially be huge if there are multiple controls and users.

Is there a better design to such an approach? Appreciate some opinions. Thank you.

推荐答案

在DB中存储控件位置的唯一原因是使人们可以设计自己的表单的系统.另一个问题是,这样的系统可能会导致表单具有绝对定位,从而失去HTML在不同大小的屏幕上流动的能力.也许您可以告诉我们您希望从中获得什么好处?无论哪种方式,您都可以在首次加载时存储位置,而在回发时不读取它们.
The only reason to store the position of controls in the DB, is to make a system where people can design their own forms. The other issue is, such a system would probably result in forms with absolute positioning, losing HTML''s ability to flow for different size screens. Perhaps you could tell us what the benefit is that you expect to get from this ? Either way, you could store the positions on first load and not read them again on postback.


这篇关于在数据库上存储业务逻辑,控件属性,数据验证的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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