中の技術日誌ブログ

C#とC++/CLIと
VBと.NETとWindowsで戯れる
 

目次

Blog 利用状況

ニュース

自己紹介

東京でソフトウェアエンジニアをやっています。
お仕事大募集中です。
記事執筆や、講師依頼とかでも何でもどうぞ(*^_^*)
似顔絵 MSMVPロゴ
MSMVP Visual C# Since 2004/04-2013/03

記事カテゴリ

書庫

日記カテゴリ

00-整理

01-MSMVP

変数スコープ 続き

先ほどは
  • 局所スコープ
  • 関数スコープ
  • クラススコープ
  • アプリケーションスコープ

と4つのスコープを意識し用という話をしつつ脱線しましたが話を戻します。

ここにあげた4つのスコープはあくまで単体アプリケーションの場合を意味します。

Webアプリケーションの場合にはさらに増えることになります。
古来のASPより一般的に利用されるのはSessionというスコープです。

これはユーザが利用開始より利用終了までの間生存しているというものです。

  • 局所スコープ
  • 関数スコープ
  • クラススコープ
  • セッションスコープ
  • アプリケーションスコープ

Webアプリケーションの場合複数のユーザが同時にアプリケーションにアクセスします。
アプリケーションではユーザ情報を管理してはいけないことになります。

セッション変数はそのユーザ処理にとってはグローバル変数になるので、入念な設計が必要です。
セッション変数への格納名が同じで上書きしちゃったなんてことのないように。

#ただし、ASP.Netではメモリの6割が利用されることによりIISのアプリケーションプールが再起動されて、セッション情報は失われてしまいます。
#これらを回避するにはステートサーバというSQLServerにセッション情報を格納する方法を取るより他はないとされています。

  • 局所スコープ
  • 関数スコープ
  • クラススコープ
  • ビューステートスコープ
  • セッションスコープ
  • アプリケーションスコープ

ビューステートはASP.Netがページ内に閉じた世界で持ちまわってくれます。
別のページに持っていく場合にはRequestに付加するなりして持っていかなければもってはいけませんが、ページ内で閉じた世界ではかなり有効に働きます。

ただパフォーマンス的にはいちいち持っておろしているので、Sessionの非ではありません。残念ながら。

このようにWebアプリケーションになるとそのスコープは増加します。

増加するといっても基本は同じでスコープが広がると影響が大きくなり、スコープが小さくなると影響も小さくなるということです。

適切な設計を行いより小さなスコープを生かしましょう。

投稿日時 : 2004年6月6日 23:47

コメントを追加

# RmdQFYGFjqKZnXBlnNx 2021/07/03 2:44 https://amzn.to/365xyVY

There is visibly a bundle to realize about this. I feel you made some good points in features also.

# PVzDysvjwSnbQC 2021/07/03 4:14 https://www.blogger.com/profile/060647091882378654

Very good blog article.Thanks Again. Really Great.

# Illikebuisse gxcqy 2021/07/04 19:24 pharmaceptica

tadalafil vs vardenafil https://pharmaceptica.com/

# re: ?????? ?? 2021/08/08 3:20 how safe is hydroxychloroquine

chloroquine phosphate side effects https://chloroquineorigin.com/# hydroxychlor 200 mg

# I was recommended this web site by my cousin. I am not sure whether this post is written by him as nobody else know such detailed about my difficulty. You're amazing! Thanks! 2021/08/28 10:49 I was recommended this web site by my cousin. I am

I was recommended this web site by my cousin. I am not sure whether this post is written by him as nobody else know
such detailed about my difficulty. You're amazing!
Thanks!

# My coder is trying to convince me to move to .net from PHP. I have always disliked the idea because of the costs. But he's tryiong none the less. I've been using WordPress on a variety of websites for about a year and am concerned about switching to anot 2021/09/04 13:20 My coder is trying to convince me to move to .net

My coder is trying to convince me to move to .net from
PHP. I have always disliked the idea because of the costs.

But he's tryiong none the less. I've been using WordPress on a variety of websites for
about a year and am concerned about switching to another
platform. I have heard great things about blogengine.net.
Is there a way I can transfer all my wordpress posts into it?
Any help would be greatly appreciated!

# My coder is trying to convince me to move to .net from PHP. I have always disliked the idea because of the costs. But he's tryiong none the less. I've been using WordPress on a variety of websites for about a year and am concerned about switching to anot 2021/09/04 13:21 My coder is trying to convince me to move to .net

My coder is trying to convince me to move to .net from
PHP. I have always disliked the idea because of the costs.

But he's tryiong none the less. I've been using WordPress on a variety of websites for
about a year and am concerned about switching to another
platform. I have heard great things about blogengine.net.
Is there a way I can transfer all my wordpress posts into it?
Any help would be greatly appreciated!

# My coder is trying to convince me to move to .net from PHP. I have always disliked the idea because of the costs. But he's tryiong none the less. I've been using WordPress on a variety of websites for about a year and am concerned about switching to anot 2021/09/04 13:22 My coder is trying to convince me to move to .net

My coder is trying to convince me to move to .net from
PHP. I have always disliked the idea because of the costs.

But he's tryiong none the less. I've been using WordPress on a variety of websites for
about a year and am concerned about switching to another
platform. I have heard great things about blogengine.net.
Is there a way I can transfer all my wordpress posts into it?
Any help would be greatly appreciated!

# My coder is trying to convince me to move to .net from PHP. I have always disliked the idea because of the costs. But he's tryiong none the less. I've been using WordPress on a variety of websites for about a year and am concerned about switching to anot 2021/09/04 13:23 My coder is trying to convince me to move to .net

My coder is trying to convince me to move to .net from
PHP. I have always disliked the idea because of the costs.

But he's tryiong none the less. I've been using WordPress on a variety of websites for
about a year and am concerned about switching to another
platform. I have heard great things about blogengine.net.
Is there a way I can transfer all my wordpress posts into it?
Any help would be greatly appreciated!

# Great article, just what I wanted to find. scoliosis surgery https://coub.com/stories/962966-scoliosis-surgery scoliosis surgery 2021/09/14 7:55 Great article, just what I wanted to find. scolios

Great article, just what I wanted to find. scoliosis surgery
https://coub.com/stories/962966-scoliosis-surgery scoliosis surgery

# Great article, just what I wanted to find. scoliosis surgery https://coub.com/stories/962966-scoliosis-surgery scoliosis surgery 2021/09/14 7:56 Great article, just what I wanted to find. scolios

Great article, just what I wanted to find. scoliosis surgery
https://coub.com/stories/962966-scoliosis-surgery scoliosis surgery

# Great article, just what I wanted to find. scoliosis surgery https://coub.com/stories/962966-scoliosis-surgery scoliosis surgery 2021/09/14 7:57 Great article, just what I wanted to find. scolios

Great article, just what I wanted to find. scoliosis surgery
https://coub.com/stories/962966-scoliosis-surgery scoliosis surgery

# Great article, just what I wanted to find. scoliosis surgery https://coub.com/stories/962966-scoliosis-surgery scoliosis surgery 2021/09/14 7:58 Great article, just what I wanted to find. scolios

Great article, just what I wanted to find. scoliosis surgery
https://coub.com/stories/962966-scoliosis-surgery scoliosis surgery

# Inspiring story there. What happened after? Take care! 2021/10/25 15:25 Inspiring story there. What happened after? Take c

Inspiring story there. What happened after?
Take care!

# Hi there everybody, here every person is sharing these kinds of knowledge, so it's fastidious to read this web site, and I used to pay a visit this webpage everyday. 2021/11/12 16:40 Hi there everybody, here every person is sharing t

Hi there everybody, here every person is sharing these kinds of
knowledge, so it's fastidious to read this web site, and
I used to pay a visit this webpage everyday.

# Hi there everybody, here every person is sharing these kinds of knowledge, so it's fastidious to read this web site, and I used to pay a visit this webpage everyday. 2021/11/12 16:40 Hi there everybody, here every person is sharing t

Hi there everybody, here every person is sharing these kinds of
knowledge, so it's fastidious to read this web site, and
I used to pay a visit this webpage everyday.

# Hi there everybody, here every person is sharing these kinds of knowledge, so it's fastidious to read this web site, and I used to pay a visit this webpage everyday. 2021/11/12 16:41 Hi there everybody, here every person is sharing t

Hi there everybody, here every person is sharing these kinds of
knowledge, so it's fastidious to read this web site, and
I used to pay a visit this webpage everyday.

# Hi there everybody, here every person is sharing these kinds of knowledge, so it's fastidious to read this web site, and I used to pay a visit this webpage everyday. 2021/11/12 16:42 Hi there everybody, here every person is sharing t

Hi there everybody, here every person is sharing these kinds of
knowledge, so it's fastidious to read this web site, and
I used to pay a visit this webpage everyday.

# http://perfecthealthus.com 2021/12/24 4:24 Dennistroub

http://solarcore.unblog.fr/2020/06/12/pain-of-invention/

タイトル
名前
URL
コメント