会话变量 - 好或坏 [英] Session Variables - Good or Bad

查看:53
本文介绍了会话变量 - 好或坏的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我来自旧的ASP阵营,其中没有使用会话变量。当

i在2001年开始使用ASP.NET时,我再次开始使用它们,因为从我读过的内容中它是好的。


我已经愉快地使用Session变量已经三年了,而且我已经和我的新老板一起进入了一个项目,而这个项目从来没有完全出现过这个

会话变量没问题。


这里的共识是什么?我怎么能说服他们说他们没关系

ASP.NET。或者


还有那些人认为他们不好用吗?


TIA

Harry Simpson

MCSD

I''ve come from the old ASP camp where session variables were not used. When
i started using ASP.NET in 2001, I started using them again because it was
ok from what I''d read.

I''ve been merrily using Session variables for three years now and i''m
entering a project with my new boss who has never quite come around that
session variables are ok.

What''s the concensus here. How can i convince him that they are ok in
ASP.NET. OR

Are there those out there that still think they aren''t good to use?

TIA

Harry Simpson
MCSD

推荐答案

会话变量 - 糟糕。


所有会话状态方案都依赖于一个集中模型 - 它永远不会对b / b有利。


但如果这意味着你将拥有为具有
$ 5并发用户的网站编写大量代码,然后继续使用''em。 (从不overarchitect)。


- Sahil Malik

你可以通过我的博客联系我
http://www.dotnetjunkies.com/weblog/sahilmalik

" Harry Simpson" < HS ******* @ nospamphgt.net>在留言中写道

news:%2 *************** @ tk2msftngp13.phx.gbl ...
Session variables - bad.

All the session state schemes rely on a centralized model - that can never
be good for scaleability.

But if it means you will have to write tonnes of code for a website that has
5 concurrent users, then go ahead use ''em. (never overarchitect).

- Sahil Malik
You can reach me thru my blog at
http://www.dotnetjunkies.com/weblog/sahilmalik
"Harry Simpson" <hs*******@nospamphgt.net> wrote in message
news:%2***************@tk2msftngp13.phx.gbl...
我是来自旧的ASP阵营,其中没有使用会话变量。
当我在2001年开始使用ASP.NET时,我又开始使用它们了,因为它从我读过的内容开始就可以了。

我一直在愉快地使用它会话变量现在已经三年了,而且我和我的新老板一起进入了一个项目,这个老板从来没有完全认识过那个会话变量是好的。

什么是这里的共识。我如何让他相信他们在ASP.NET中没问题。或者

那些仍然认为他们不好用的人吗?

TIA

Harry Simpson
MCSD
I''ve come from the old ASP camp where session variables were not used. When i started using ASP.NET in 2001, I started using them again because it was
ok from what I''d read.

I''ve been merrily using Session variables for three years now and i''m
entering a project with my new boss who has never quite come around that
session variables are ok.

What''s the concensus here. How can i convince him that they are ok in
ASP.NET. OR

Are there those out there that still think they aren''t good to use?

TIA

Harry Simpson
MCSD



我们只在没有其他(简单)的方式使用它。

基本上它没有完成或你必须有一个很好的理由。

如果你在完成它们的时候不打扫它们......你会得到

惩罚... ;-)


viewstate和querystring可以覆盖大多数变量,将
传递到另一个屏幕。

但这仅仅是我们的政策......


" Harry Simpson" < HS ******* @ nospamphgt.net> schreef in bericht

新闻:%2 *************** @ tk2msftngp13.phx.gbl ...
We use it only if there is no other (easy) way.
Basicly its not done or you have to have a very good reason.
And if you dont clean them up when you''re done with them....you''ll get
punished ...;-)

Most variables can be covered by the viewstate and querystring to pass them
to an other screen.
But thats just our policy I guess....

"Harry Simpson" <hs*******@nospamphgt.net> schreef in bericht
news:%2***************@tk2msftngp13.phx.gbl...
我''来自旧的ASP阵营,其中没有使用会话变量。
当我在2001年开始使用ASP.NET时,我再次开始使用它们,因为它可以从我读过的内容中找到它。

我已经愉快地使用会话变量已经三年了,而且我正在和我的新老板一起进入一个项目,他从来没有完全认识过那个会话变量是好的。

这里的共识是什么。我如何让他相信他们在ASP.NET中没问题。或者

那些仍然认为他们不好用的人吗?

TIA

Harry Simpson
MCSD
I''ve come from the old ASP camp where session variables were not used.
When i started using ASP.NET in 2001, I started using them again because
it was ok from what I''d read.

I''ve been merrily using Session variables for three years now and i''m
entering a project with my new boss who has never quite come around that
session variables are ok.

What''s the concensus here. How can i convince him that they are ok in
ASP.NET. OR

Are there those out there that still think they aren''t good to use?

TIA

Harry Simpson
MCSD



我不同意到目前为止给出的两个答案,ASP中的会话是邪恶的''cuz

它们存储在与工作进程相同的内存空间。当你为InProc设置它时,这也是ASP.Net中的
true。对于

,StateServer或SQLServer都不是这样。就可扩展性而言,SqlServer模式

可以很好地扩展,并且不依赖于集中模型(不比任何其他SQL Server数据库更好)。什么是更好的是

切换模式是多么容易 - 只要你小心设计所有

的对象作为可序列化存储在会话中(通常只需通过

指定类的ISerializableAttribute())你只需更改你的

web.config然后就可以了。


最后,ASP.Net 2.0的供应商模型将提供更多选择。


Karl


-

MY ASP.Net教程
http://www.openmymind。 net /

" Sahil Malik" <共***************** @ nospam.com>在消息中写道

新闻:O5 ************** @ TK2MSFTNGP09.phx.gbl ...
I disagree with the two answers given so far, sessions in ASP were evil ''cuz
they were stored in the same memory space as the worker process. This is
true in ASP.Net as well when you have it set for InProc. It isn''t true for
either StateServer or SQLServer. As far as scalability, SqlServer mode
scales very well and doesn''t rely on a centralized model (no more so than
any other SQL Server database). What''s even better is how easy it is to
switch modes - so long as you were careful to design all objects which are
to be stored in sessions as serializable (normally achieved simply by
specifying the ISerializableAttribute() to the class) you simply change your
web.config and off you go.

Finally, ASP.Net 2.0''s provider model will provide even more choice.

Karl

--
MY ASP.Net tutorials
http://www.openmymind.net/
"Sahil Malik" <co*****************@nospam.com> wrote in message
news:O5**************@TK2MSFTNGP09.phx.gbl...
会话变量 - 不好。

所有的会议状态方案都依赖于一个集中的模型 - 它永远不会有利于可扩展性。

但如果这意味着你将不得不写出吨数
有5个并发用户的网站代码,然后继续使用''em。 (绝不是overarchitect)。

- Sahil Malik
你可以通过我的博客与我联系
http://www.dotnetjunkies.com/weblog/sahilmalik

" Harry Simpson" < HS ******* @ nospamphgt.net>在消息中写道
新闻:%2 *************** @ tk2msftngp13.phx.gbl ...
Session variables - bad.

All the session state schemes rely on a centralized model - that can never
be good for scaleability.

But if it means you will have to write tonnes of code for a website that has 5 concurrent users, then go ahead use ''em. (never overarchitect).

- Sahil Malik
You can reach me thru my blog at
http://www.dotnetjunkies.com/weblog/sahilmalik
"Harry Simpson" <hs*******@nospamphgt.net> wrote in message
news:%2***************@tk2msftngp13.phx.gbl...
我来自不使用会话变量的旧ASP阵营。
I''ve come from the old ASP camp where session variables were not used.


我在2001年开始使用ASP.NET时,我再次开始使用它们,因为
可以从我会读到的。

我已经愉快地使用Session变量已经三年了,而且我正在和我的新老板一起进入一个项目
会话变量没问题。

这里的共识是什么。我如何让他相信他们在ASP.NET中没问题。或者

那些仍然认为他们不好用的人吗?

TIA

Harry Simpson
MCSD
i started using ASP.NET in 2001, I started using them again because it was ok from what I''d read.

I''ve been merrily using Session variables for three years now and i''m
entering a project with my new boss who has never quite come around that
session variables are ok.

What''s the concensus here. How can i convince him that they are ok in
ASP.NET. OR

Are there those out there that still think they aren''t good to use?

TIA

Harry Simpson
MCSD




这篇关于会话变量 - 好或坏的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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