我在哪裡!?

"Operation"與 "Method"的差異

我以前一直認為, operation 與 method 是相同的,不過在看過定義之後,確實有所不同

Applying UML and patterns[Craig Larman] ,P186中,有這樣一段擷取自UML對operation的定義

The UML formally defines operations.

An operation is a specification of a transformation or query that an object may be called to execute [RJB99]

在其之下也說明了operation 與 method 在UML中的精神

For example, the elements of an interface are operations, in UML terms. An operation is an abstraction, not an implementation. By contrast, a method(in the UML) is an implementation of an operation.

如此一來也解決了我的疑惑…

Object-Oriented Methods: A Foundation, UML Edition (2nd Edition)書中,也是把operation 與 method 分成兩個章節來解說,回家翻翻看這本書是如何說明的.再來分享~

1 comment to "Operation"與 "Method"的差異

  • 老實說,上面那個定義實在沒啥意義,可說是幾近廢話。

    軟體設計的思考,不是在這類小地方上。

    若以該主題來說的話,反而該思考的是,什麼是 抽象、規格、與實做。

    這些概念是一種對比,思考這些,對軟體設計才真正有幫助。

Leave a Reply

 

 

 

You can use these HTML tags

<a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>