- 475 名前:デフォルトの名無しさん mailto:sage [04/02/19 10:52]
- ついでにhomepage.mac.com/mkino2/oop/chainOfResp/index.html
の Chain of Responsibility を JS で。 var app = new Object; app.preview = function(){alert("preview in app");} function make_app(){} make_app.prototype = app; var dialog = new make_app; dialog.print = function(){alert("print in dialog");} function make_dialog(){} make_dialog.prototype = dialog; var button = new make_dialog; button.help = function(){alert("help in button");} button.help(); button.print(); button.preview() すっきり書けてるほうとは思うけど、どうも…
|

|