关于.NET分布式代码的完全简单的问题 [英] completely simple question about .NET distributed code

查看:55
本文介绍了关于.NET分布式代码的完全简单的问题的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我们开发了一个.NET类库,它定义了一系列可重复使用的业务对象。
。类库是用C#开发的,而

效果很好。


然而,一个问题是随着越来越多的应用程序正在使用>
开发用于使用这个类库,我们正在运行部署

和版本控制问题。


i回忆了很多这类事情使用分布式的
应用程序模型解决,例如EJB规范,我过去使用过

。从我的阅读来看,似乎分布式模型为

..NET代码是Web服务。那么我的问题有三个:


1)这个假设是正确的吗? .NET的分布式代码模型是否使用Web服务?


2).NET对象可通过XML传输到网上

消息?例如,一个Web服务可以返回一个数据表吗?


2)因为Web服务使用XML作为进程间消息格式,所以有消息的任何重大问题吞吐量是多少?例如,如果

我的类库的一个类中的一个方法返回数百行

数据作为报告方法的一部分,是否会有很大的开销

将这些信息封装在XML消息中?


请随时纠正我的问题的任何错误事实

谓词,或回答那些正在走上正轨。我很感激任何

帮助解决这个基本的分发问题,


jason

we have developed a .NET class library that defines a family of
reusable business objects. the class library is developed in C#, and
works quite well.

one problem, however, is that as more and more applications are being
developed to consume this class library, we are running into deployment
and version controll issues.

i recall a lot of this kind of thing being solved with distributed
application models, such as the EJB specification, which i worked with
in the past. from my reading, it seems like the distributed model for
..NET code is "Web Services". my questions then are threefold:

1) is this assumption correct? that the distributed code model for .NET
is using web services?

2) are .NET objects transportable across the wire through the XML
messaging? for example can a web service return a datatable?

2) since web services use XML as the interprocess message format, are
there any significant issues with message throughput? for example, if
one method in one class of my class library returns hundreds of rows of
data as part of a reporting method, would there be significant overhead
encapsulating that information in the XML message?

please feel free to correct any false facts that my questions
predicate, or answer the ones that are on track. i would appreciate any
help with this basic distribution question,

jason

推荐答案

Jason,

Web服务是分布式代码的模型之一。 Web服务

通常用于客户端和服务之间的边界需要

互操作性(例如.NET到java或其他一些技术)。


还有其他技术,即企业服务(COM +)

和远程处理。另外还有Windows通信基金会

(老实说,它可以完成所有工作,如果你有时间,我会将b $ b定为开发目标)。 />

转到第二个问题,是的,.NET对象可以通过Web服务运输

。 XML序列化用于该序列化

,并且您的类型受到这些限制。


远程处理可以使用SOAP格式化或二进制序列化,两者都可以其中

是真实的序列化技术。 WCF在线路上序列化实例的方式很灵活。


回答你的第二个第二个问题,是的,这将是开销的b $ b。一般来说,XML是一种描述数据的冗长方式(基于文本,自我描述),因此随着数据量的增大,时间到了
序列化数据增长。在远程处理,WCF和COM +

中使用的二进制格式更快,但最终,从一个实例转换为

格式在线上,这总是受制于实例中的数据量为
。它只是一些编码比其他编码更快。


另一件需要考虑的事情是,Web服务是无状态的,而其他选项都是暴露的

进入会话状态时有多种选择。


此外,您还有其他要求吗?谁会使用这些?您需要验证和授权访问吗?
?您的客户是否运行

..NET?你需要会话状态吗?


这些问题和编码问题一样重要。如果你回答他们,那么我们可以让你更好地了解要走哪条路。


希望这会有所帮助。

-

- Nicholas Paldino [.NET / C#MVP]

- mv*@spam.guard.caspershouse.com


" jason" < IA **** @ yahoo.com>在消息中写道

news:11 ********************* @ z14g2000cwz.googlegro ups.com ...
Jason,

Web services are one of the models for distributed code. Web services
are used typically when the boundary between client and service requires
interoperability (such as .NET to java, or some other technology).

There are other technologies as well, namely, Enterprise Services (COM+)
and remoting. Also on the horizon is the Windows Communication Foundation
(which does everything, quite honestly, and if you have the time, I would
target that for development).

Moving on to your second question, yes, .NET objects are transportable
across web services. XML Serialization is used for that serialization
across the wire, and your types are subject to those limitations.

Remoting can use SOAP formatting or Binary serialization, both of which
are "true" serialization technologies. WCF is flexible in how the instances
are serialized on the wire.

To answer your "second" second question, yes, there is going to be
overhead. In general, XML is a verbose way of describing data (text-based,
self-describing), so as the amount of data grows larger, the time to
serialize that data grows. Binary formats used in remoting, WCF, and COM+
are faster, but ultimately, there is a transformation from an instance to
the format on the wire, and that is always subject to the amount of data in
the instance. Its just that some encodings are faster than others.

Another thing to think about is the fact that web services are
stateless, while the other options all expose a number of options when it
comes to session state.

Also, do you have other requirements? Who is going to use these? Do
you have to authenticate and authorize access? Are your clients running
..NET or not? Do you require session state?

These questions are just as important as the encoding question. If you
answer them, then we can give you a better idea of what path to head down.

Hope this helps.
--
- Nicholas Paldino [.NET/C# MVP]
- mv*@spam.guard.caspershouse.com

"jason" <ia****@yahoo.com> wrote in message
news:11*********************@z14g2000cwz.googlegro ups.com...
我们开发了一个.NET类库,它定义了一系列可重用的业务对象。类库是用C#开发的,并且工作得很好。然而,一个问题是随着越来越多的应用程序被开发来使用这个类库,我们正在进行部署
和版本控制问题。
我想起了很多用分布式应用程序模型解决的问题,例如EJB规范,我过去曾与
合作过。从我的阅读来看,似乎.NET代码的分布式模型是Web服务。我的问题有三个:

1)这个假设是正确的吗? .NET的分布式代码模型是否正在使用Web服务?

2).NET对象是否可通过XML
消息传递到网上?例如,Web服务是否可以返回数据表?

2)因为Web服务使用XML作为进程间消息格式,所以消息吞吐量是否有任何重大问题?例如,如果我的类库的一个类中的一个方法返回数百行
数据作为报告方法的一部分,那么在XML消息中封装该信息会有很大的开销吗? ?

请随时纠正我的问题所暗示的任何虚假事实,或回答正常的事实。我很感激任何帮助解决这个基本的分发问题,

jason
we have developed a .NET class library that defines a family of
reusable business objects. the class library is developed in C#, and
works quite well.

one problem, however, is that as more and more applications are being
developed to consume this class library, we are running into deployment
and version controll issues.

i recall a lot of this kind of thing being solved with distributed
application models, such as the EJB specification, which i worked with
in the past. from my reading, it seems like the distributed model for
.NET code is "Web Services". my questions then are threefold:

1) is this assumption correct? that the distributed code model for .NET
is using web services?

2) are .NET objects transportable across the wire through the XML
messaging? for example can a web service return a datatable?

2) since web services use XML as the interprocess message format, are
there any significant issues with message throughput? for example, if
one method in one class of my class library returns hundreds of rows of
data as part of a reporting method, would there be significant overhead
encapsulating that information in the XML message?

please feel free to correct any false facts that my questions
predicate, or answer the ones that are on track. i would appreciate any
help with this basic distribution question,

jason



是的,这有点帮助,不仅回答我所拥有的问题,还要帮助制定我应该问的其他问题。非常感谢

很感激。


我们写的所有东西都在.NET平台上,所以听起来像是

Web服务的主要优势不会是我们立即受益的
。希望这意味着我们将能够选择您提到的其他分布式技术之一,并且

更快的传输。


但要回答你提出的可能影响最终

选择的问题:


图书馆提供的对象主要由几个人消费

web应用程序(一个经典的ASP即将转换为.NET,

其他已经是.NET),还有几个命令行应用程序

(也是.NET)以及将来可能的一些服务应用程序(也是
..NET)。没有传统的客户端,只有少数的几个b $ b应用程序,除了其中一个是现在的.NET之外,很快就会成为.NET的例外。


我们在应用程序演示级别控制状态,并在数据行级别获取信息

访问权限(以及应用程序中的一点点数)

等级),所以我不确定我们是否需要进行身份验证,并且

授权访问库本身。虽然如果有一个简单的方法来注册订阅应用程序以使用库,

这将非常漂亮。我认为我们不需要在库级执行

会话状态,因为它仅用于原子数据交互。会话状态目前由

消费应用程序处理。


这些信息会影响选择吗?再次感谢

给出的建议,


jason

yes, this helps quite a bit, not only answer the questions i did have,
but helping formulate other questions i should be asking. i very much
appreciate it.

everything we are writing is on the .NET platform, so it sounds like
the primary advantage of the web services would not be something we
immediately would benefit from. hopefully that means we will be able to
choose one of the other distributed technologies you mention, with the
faster transmission.

but to answer questions you raised that might influence the final
choice:

the objects that the library provide are consumed primarily by several
web applications (one classic ASP about to be converted to .NET, the
other is already .NET), but also by several command line applications
(also .NET) and in the future probably some service applications (also
..NET). there are no conventional clients, only these handful of
applications, all but one of which are .NET now, the exception to be
made .NET soon.

we control state at the application presentation level, and information
access at the data row level (and a little bit at the application
level), so i''m not sure that we would need to authenticate and
authorize access to the libraries themselves. though if there''s an easy
way to register subscribing applications to the use of the library,
that would be pretty spiffy. i don''t think we would need to perform
session state at the library level either, as it is only used for
atomic data interactions. session state is currently handled by the
consuming applications.

does this information influence the choices? thanks again for the
advice already given,

jason


Jason,


好​​吧,他们都是传统的客户。他们希望使用

服务,对吧?无论它们是什么都没关系,只要它们消耗,

它们就是客户。


当我说会话状态时,我的意思是如果你得到一个对象的参考,那么对一个方法的调用会影响对该对象的其他

方法的调用吗?您是否需要该实例的身份,

或不?听起来最可能的答案是否定的。


就个人而言,我不会使用远程处理,因为它是一种技术

一旦WCF发布了
,就会有所改进。


我建议使用企业服务,这将提供一个

到时候更容易升级到WCF的路径。

-

- Nicholas Paldino [.NET / C#MVP]

- mv*@spam.guard.caspershouse.com

" jason" < IA **** @ yahoo.com>在消息中写道

news:11 ********************** @ z14g2000cwz.googlegr oups.com ...
Jason,

Well, they are all conventional clients. They are looking to consume a
service, right? It doesn''t matter what they are, as long as they consume,
they are the client.

When I say session state, I mean in the sense of, if you get a reference
to an object, do the calls to one method influence the calls to other
methods on that object? Do you have a need for identity on that instance,
or no? It sounds like the most likely answer to this is no.

Personally, I wouldn''t use remoting for this, as it is a technology
which is going to get little in the way of improvements once WCF is
released.

I would recommend going with enterprise serivces, which will provide an
easier upgrade path to WCF when the time comes.
--
- Nicholas Paldino [.NET/C# MVP]
- mv*@spam.guard.caspershouse.com
"jason" <ia****@yahoo.com> wrote in message
news:11**********************@z14g2000cwz.googlegr oups.com...
是的,这有点帮助,不仅回答我所拥有的问题,而且还帮助制定我应该问的其他问题。我非常感激。

我们正在编写的所有内容都在.NET平台上,所以听起来好像Web服务的主要优势不是我们<马上就会受益匪浅。希望这意味着我们将能够选择您提及的其他分布式技术之一,以便更快地传输。

但是要回答您提出的可能影响最终结果的问题
选择:

库提供的对象主要由几个web应用程序消耗(一个经典的ASP即将转换为.NET,
其他是已经.NET),但也有几个命令行应用程序(也是.NET)和未来可能的一些服务应用程序(也是.NET)。没有传统的客户端,只有少数几个
应用程序,除了其中一个是.NET之外,很快就会成为.NET的例外。

我们控制状态在应用程序表示级别,以及数据行级别的信息访问(以及应用程序级别的一点点),所以我不确定我们是否需要进行身份验证和
授权访问库本身。虽然如果有一种简单的方法来注册订阅应用程序以使用库,那将是非常漂亮的。我不认为我们需要在库级执行会话状态,因为它仅用于原子数据交互。会话状态目前由消费的应用程序处理。

这些信息会影响选择吗?再次感谢已经给出的建议,

jason
yes, this helps quite a bit, not only answer the questions i did have,
but helping formulate other questions i should be asking. i very much
appreciate it.

everything we are writing is on the .NET platform, so it sounds like
the primary advantage of the web services would not be something we
immediately would benefit from. hopefully that means we will be able to
choose one of the other distributed technologies you mention, with the
faster transmission.

but to answer questions you raised that might influence the final
choice:

the objects that the library provide are consumed primarily by several
web applications (one classic ASP about to be converted to .NET, the
other is already .NET), but also by several command line applications
(also .NET) and in the future probably some service applications (also
.NET). there are no conventional clients, only these handful of
applications, all but one of which are .NET now, the exception to be
made .NET soon.

we control state at the application presentation level, and information
access at the data row level (and a little bit at the application
level), so i''m not sure that we would need to authenticate and
authorize access to the libraries themselves. though if there''s an easy
way to register subscribing applications to the use of the library,
that would be pretty spiffy. i don''t think we would need to perform
session state at the library level either, as it is only used for
atomic data interactions. session state is currently handled by the
consuming applications.

does this information influence the choices? thanks again for the
advice already given,

jason



这篇关于关于.NET分布式代码的完全简单的问题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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