110 likes | 298 Views
Method Specification Section in Chapter 14. Alan Dennis, Barbara Wixom, and David Tegarden John Wiley & Sons, Inc. Slides by Fred Niederman Edited by Solomon Negash. Method Specification. A transition between analysts and programmers:
E N D
Method Specification Section in Chapter 14 Alan Dennis, Barbara Wixom, and David Tegarden John Wiley & Sons, Inc. Slides by Fred Niederman Edited by Solomon Negash
Method Specification • A transition between analysts and programmers: • Analysts describe individual classes and methods in detail • Programmers take over and begin writing code • Written documents that include explicit instructions on how to write the code to implement the method
Method Specification Components • Typical method specifications contain four components: • General information • Events • Message Passing • Algorithm Specification
General Information • Name of the method • Name of the class in which the method reside • ID number • Contract ID that identifies the contract associated with this method implementation • Programmer assigned • Date due • Target programming language
Events • An event is a thing that happens or takes place. • Example: clicking the mouse generates a mouse event. • After initializing a system waits for an event to occur • When a method is fired it carries out the appropriate task • Event-driven programming instructions like behavioral state machines can be used.
Message passing • Message passing to and from the method • Message passing is identified in the sequence diagram (or collaboration diagram) • Programmers need to understand what arguments are being passed into, from, and returned by the method.
Algorithm Specification • Algorithm specifications can be written in Structured English, some form of pseudocode • Structured English is like a simple programming language. • Many versions of Structured English exist because there are no formal standards.
(Get CD-info module) Accept (CD_title) {Required} Accept (CD_artist) {Required} Accept (CD_category) {Required} Accept (CD_length) Return Pseudocode Example
Method Specification Form • Refer to Figure 14-1 in the text.