UML类图简单理解
广饶网站建设公司成都创新互联公司,广饶网站设计制作,有大型网站制作公司丰富经验。已为广饶1000多家提供企业网站建设服务。企业网站搭建\外贸网站建设要多少钱,请找那个售后服务好的广饶做网站的公司定做!

首先拿出动物这个框来看:

这个代表的是一个类,类图分为三层,第一行是类的名字,大家可以看到“动物”两个字是斜体的,这证明他是抽象类。第二行是类的特征,通常是字段和属性。第三层是类的操作,行为方法。前面的符号分别代表者,“+”->public,“-”->private,“#”->protected。
再来看看接口:

“飞翔”这个框字的上面已经标示了interface了,所以一看就知道是接口。第一层是名字,第二层是他的行为。接口的另一种方法就是右边的,唐老鸭,俗称棒棒糖表示法。唐老鸭实现了说话的接口。
下面来认识里面关系用什么连接的吧:
继承:
继承:

实现接口:

关联关系:

聚合:

合成:

依赖关系:

其实很简单,慢慢接触就好多了。这个UML图是从《大话设计模式》截过来的,很不错的一本书。
分享文章:UML类图简单理解
转载源于:http://scyanting.com/article/pppdie.html