是否需要部分类功能 [英] Is Partial Class feature required

查看:58
本文介绍了是否需要部分类功能的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

想从群众中了解到为什么我们需要一个部分类。通过

有这样的功能,我们不会超出实体概念的范围。


帮助我理解这个功能在哪种情况下更好,当它是

没有。


感谢您的阅读

-

永远不要说,给up

解决方案

Dara P< Da *** @ discussion.microsoft.comwrote:


想从群众中了解到为什么我们需要一个部分类。通过

有这样的功能,我们不会超出实体概念的范围。


帮助我理解这个功能在哪种情况下更好,什么时候

没有。



它们有用的主要区域是生成的代码,在这里你需要一些类的代码自动生成(例如,由
设计师或ORM系统),有些是手工编码的。部分课程是实现这一目标的好方法。


-

Jon Skeet - < sk *** @ pobox .com>
http://www.pobox.com/~skeet博客: http://www.msmvps.com/jon.skeet

如果回复小组,请不要给我发邮件


将工具生成的代码与开发人员编写的代码分开真的很有帮助

代码,这样就不会搞砸其他人的代码。


Dara P写道:


想从人群中知道为什么我们需要一个部分类。通过

有这样的功能,我们不会超出实体概念的范围。


帮助我理解这个功能在哪种情况下更好,当它是

没有。


感谢您的阅读

-

永远不要说,给up


5月10日上午9:29,Dara P< D ... @ discussion.microsoft.comwrote:


想从群众中了解到为什么我们需要一个部分类。通过

有这样的功能,我们不会超出实体概念的范围。


帮助我理解这个功能在哪种情况下更好,当它是

没有。


感谢您的阅读

-

永远不要说,给up



嘿,


我想补充一点,原因是团队工作部分

班。


您可以在班级开发团队中分发班级开发,并且可以并行工作
,而不必搞砸,


Would like to know from the crowd that why do we require a Partial Class. By
having such feature aren''t we going out of the scope of Entity Concept.

Help me to understand in what context this feature is better and when it is
not.

Thanks for reading
--
Never say, Give up

解决方案

Dara P <Da***@discussions.microsoft.comwrote:

Would like to know from the crowd that why do we require a Partial Class. By
having such feature aren''t we going out of the scope of Entity Concept.

Help me to understand in what context this feature is better and when it is
not.

The main area where they''re useful is with generated code, where you
want some of the code for a class to be autogenerated (e.g. by a
designer, or ORM system) and some to be hand-coded. Partial classes are
a good way of achieving this.

--
Jon Skeet - <sk***@pobox.com>
http://www.pobox.com/~skeet Blog: http://www.msmvps.com/jon.skeet
If replying to the group, please do not mail me too


It is really helpful in separating tool-generated code from developer-written
code so that one cannot mess up other''s code.

"Dara P" wrote:

Would like to know from the crowd that why do we require a Partial Class. By
having such feature aren''t we going out of the scope of Entity Concept.

Help me to understand in what context this feature is better and when it is
not.

Thanks for reading
--
Never say, Give up


On May 10, 9:29 am, Dara P <D...@discussions.microsoft.comwrote:

Would like to know from the crowd that why do we require a Partial Class. By
having such feature aren''t we going out of the scope of Entity Concept.

Help me to understand in what context this feature is better and when it is
not.

Thanks for reading
--
Never say, Give up

Hey,

I would like to add to above reasons the team work on partial
classes.

You can distribute class development across class development team and
working parallel, without having to mess things up,


这篇关于是否需要部分类功能的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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