使用这个 [英] Use of this

查看:51
本文介绍了使用这个的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述


该语句的用途是什么


what is the use of this statement

controller = BusinessController.CreateInstance();



请对其进行解释.



please explain it

推荐答案

CreateInstance()是静态方法(可能实现了SingleTone pattern以确保跨时间仅使用一个实例应用程序),它返回BusinessController 类的实例.

通常这样做是为了封装和简化客户端代码中的对象创建和初始化过程.
The CreateInstance() is a static method (Probably, implements a SingleTone pattern to make sure that only one instance is used at the times across the application) which returns an instance of the BusinessController class.

This is usually done to encapsulate and simplify the object creation and initialization process from the client codes.


请参阅C#中的Reflection以获得更多的了解.

或者,当您再次问同样的问题时,还建议您阅读一些书籍.
Refer Reflection in C# for more understanding of it.

Or and advice for you to read some books as you''ve also asked same sort of question again.


不知道BusinessController是什么样,很难知道类中有什么内容.

但是,如果BusinessController是类,则看起来好像是通过静态方法创建的某个对象的实例.

如果这是一个对象实例,则正在通过此方法创建另一个对象实例.
Without knowing what the BusinessController looks like, it difficult to know what is inside the class.

However, if the BusinessController is a class, it looks like an instance of some object is being created via a static method.

If this is an object instance, then another object instance is being created via this method.


这篇关于使用这个的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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