《模型驱动课程介绍.pptVIP

  • 3
  • 0
  • 约1.7万字
  • 约 90页
  • 2016-12-28 发布于北京
  • 举报
例6.1:取消目标模型元素的自关联 mapping Line::lineToline():Line when { not (not self.source-resolveoneIn(ellipse::eTc)-isEmpty() and not self.tareget-resolveoneIn(ellipse::eTc)-isEmpty() and self.source-resolveoneIn(ellipse::eTc)=self.tareget-resolveoneIn(ellipse::eTc)) } { …… } 在lineToline中加入when 子句 Evaluation only. Created with Aspose.Slides for .NET 3.5 Client Profile . Copyright 2004-2011 Aspose Pty Ltd. 取消目标模型元素的自关联 Evaluation only. Created with Aspose.Slides for .NET 3.5 Client Profile . Copyright 2004-2011 Aspose Pty Ltd. 抽象工厂模式转化为一般工厂模式 Evaluation only. Created with Aspose.Slides for .NET 3.5 Client Profile . Copyright 2004-2011 Aspose Pty Ltd. 将相同的子结构提取出来 Evaluation only. Created with Aspose.Slides for .NET 3.5 Client Profile . Copyright 2004-2011 Aspose Pty Ltd. 将相同的子结构提取出来 modeltype simplegraph uses http://simplegragh/; transformation NewTransformation(in source : simplegraph, out target:simplegraph); main() { source.objectsOfType(simplediagram)-map SDToSD(); } mapping simplediagram::SDToSD():simplediagram { self.nodes-forEach(r) { // result.nodes+=self.findNodeWithSameEllipse(r); if self.findNodeWithSameEllipse(r)-isEmpty() or self.findNodeWithSameEllipse(r)=null then result.nodes+=r.map NodeTNode() else { var f:=resolveIn(abstractsubnode, node)-select(e|e.nodename=father and ponents[ellipse]-first().nodename=ponents[ellipse]-first().nodename); if f-notEmpty() then {continue} endif; self.findNodeWithSameEllipse(r)-forEach(k){ result.nodes+= map abstractsubnode(r,k).father; result.lines+= map abstractsubnode(r,k).l1; result.nodes+= map abstractsubnode(r,k).son; } } endif } ; result.lines+=self.lines-map lineToline(); } Evaluation only. Created with Aspose.Slides for .NET 3.5 Client Profile . Copyright 2004-2011 Aspose Pty Ltd. 将相同的子结构提取出来 mapping node::NodeTNode():node{ result.nodename:=self.nodename; result.to:=self.to-map lineToline(); result._from:=self._from-map lineToline(); ponents:=ponents[ellipse]-map el

文档评论(0)

1亿VIP精品文档

相关文档