设计模式中的抽象或接口 [英] Abstract Or Interface in design patterm

查看:77
本文介绍了设计模式中的抽象或接口的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

Group,

这个问题非常具体针对C#中的设计模式实现。很少有设计模式,其中一个可以使用抽象类或接口实现工厂模式。

This question is very specific to the design pattern implementation in C#. There are quite few design patter one of them ids Factory pattern that could be implemented either using the abstract class or interface.

我读过的一些内容,当涉及到C#中的设计模式时,我最好使用它抽象类即使我们可能没有使用抽象类功能,而不是 界面。

Some where I read , when it comes to design patterns in C# , it i better to use abstract classes even though we may not be using abstract class features, instead of  Interface.

关于 的任何想法这个。

Any thoughts on  this.

谢谢

Gags

推荐答案

是的你是对的我也建议如果可能使用抽象类 因为它将使我们在未来扩展设计具有更好的可渗透性,但是抽象类比interfase更重要。

yes you are right I too suggest if possible use Abstract class  as it will give us the better fluxibility to extend the design in future, but abstact classes are litle bit heavier than interfase.

问候诉Pramod


这篇关于设计模式中的抽象或接口的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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