ASP经典最佳实践 [英] ASP Classic Best Practices

查看:68
本文介绍了ASP经典最佳实践的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

大家好,


我是一名拥有超过1,5年经验的ASP开发人员。偷偷摸摸了一下后来我的ASP经典世界有点不满意我的ASP代码

做法所以我想从高级/得到一些建议专业用户...

一些可以帮助我成长的建议!


我知道很多(如果不是全部)那些麻烦的东西在ASP 3中已经在ASP.NET / VS.NET(我正在研究)中更正了

但是ASP 3仍然会在很长一段时间内被b / b
(至少在Win2k3的所有生命周期中)所以我认为

仍然值得知道如何在ASP 3中正确编程。


所以这里是我的问题

- 您如何设计多层Web应用程序?什么需要进入

数据/业务/表示层?否则(如果3层对你来说太过分了,

就像我写的东西一样)你如何构建你的应用程序?

你在哪里放代码,等等...?

- 你如何访问数据库?你有自定义类来访问

数据,检索记录集吗?

- 你有没有用于显示/编辑/排序数据的数据网格类?

- 你是否将数据库连接存储为应用程序变量?

- 有用组件的一些链接(最好免费!)

- 还有其他吗?


非常感谢你关注这篇文章。


Lorenzo

解决方案

在我以前的帖子中,我忘了并且重要的主题:错误处理,

特别是表单处理错误处理,用户输入验证等...


Lorenzo


> - 您是否将数据库连接存储为应用程序变量?


从不!


>在我之前的帖子中,我忘记了重要主题:错误处理,

特别是表单处理错误处理,用户输入验证等...




我在客户端尽可能多地进行验证。这样,用户

立即得到反馈,而不是等待往返服务器。

此外,这意味着您的Web服务器收费会减少,特别是如果你的用户

base包含大比例的numbskulls(或者如果你的表单不是很好的b $ b设计:-)。

但是,我认为在服务器端进行验证也很重要(对于

格式问题,在ASP中;对于数据违规,在SQL Server中)。应该

永远不会让坏数据进入系统,而狡猾的用户可以通常找到绕过客户端验证的方法。


Hi all,

i am an ASP developer with 1,5+ years experience. After sneaking around the
ASP Classic world for a bit i became a bit dissatisfied of my ASP code
practices so i''d like to have some advice from the advanced/pro users...
some advice that would help me to grow up!

I know that many (if not all) the stuff that was a hassle in ASP 3 has been
corrected in ASP.NET/VS.NET (which i''m studying) but ASP 3 will still be
around for a long time (at least for all the lifetime of Win2k3) so i think
it would still be worth knowing how to program the right way in ASP 3.

So here are my questions
- How do you design multi-tier web applications? What needs to go in the
Data/Business/Presentation layer? Otherwise (if 3 tier is overkill for you,
as it would be for the stuff i write) how do you architect your application?
Where do you put code, ect...?
- How do you access the db? Do you have customized classes for accessing the
data, retrieving recordsets?
- Do you have any datagrid class for displaying/editing/sorting data?
- Do you store db connections as an application variable?
- Some links to useful components (preferably free!)
- Any else?

Thank You very much for paying attention to this post.

Lorenzo

解决方案

In my previous post i forgot and important subject: error handling,
especially form processing error handling, user input validation, etc...

Lorenzo


> - Do you store db connections as an application variable?

NEVER!


> In my previous post i forgot and important subject: error handling,

especially form processing error handling, user input validation, etc...



I do as much validation as I can on the client side. This way, the user
gets feedback right away, instead of waiting for a round-trip to the server.
Also, this means less toll on your web server, particularly if your user
base consists of a large ratio of numbskulls (or if your forms aren''t
designed very well :-).

However, I think it is important to also validate on the server side (for
format issues, in ASP; for data violations, in SQL Server). There should
never be a way for bad data to get into the system, and a cunning user can
usually find a way to bypass client-side validation.


这篇关于ASP经典最佳实践的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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