public CreateCommend(BoardScreen boardScreen){ this.boardScreen = boardScreen; } /** @pdOid 922ed0fa-9cef-4d41-86c8-259ac5798948 */ public void execute() { // TODO: implement boardScreen.create(); } } /*********************************************************************** * Module: EditCommend.java * Author: ct * Purpose: Defines the Class EditCommend ***********************************************************************/ import java.util.*; /** @pdOid 2420101e-20bd-4360-88a7-37f72fd00952 */ public class EditCommend extends Commend { /** @pdOid 3be7f99f-f110-4caa-8491-56311b3aabe2 */ private BoardScreen boardScreen; public EditCommend(BoardScreen boardScreen){ this.boardScreen = boardScreen; } /** @pdOid 2fe8b1d2-3dcf-44d0-8fb7-b8af7c9f36cf */ public void execute() { // TODO: implement boardScreen.edit(); } 31
} /*********************************************************************** * Module: OpenCommend.java * Author: ct * Purpose: Defines the Class OpenCommend ***********************************************************************/ import java.util.*; /** @pdOid 71ca43ed-b6e6-4912-8b4e-c35387a5d57b */ public class OpenCommend extends Commend { /** @pdOid ff24849a-10b6-4d16-8876-5675aac33f97 */ private BoardScreen boardScreen; public OpenCommend(BoardScreen boardScreen){ this.boardScreen = boardScreen; } /** @pdOid 82887f80-99f9-4479-b9d6-ad68a25b5bb6 */ public void execute() { // TODO: implement boardScreen.open(); } }
六、实验小结
本次试验大有收获,第四个要求有点看不懂,需要实现搜索代码吗?关于这几个模式该怎么用已经有点底了,但是具体应用场景仍然不清楚,感觉容易弄混。
32