目次 はじめに Abstract Classパターン Abstract ClassパターンRuby版 (by 助田雅紀さん) Balkingパターン Before/Afterパターン Futureパターン FutureパターンRuby版 (by 助田雅紀さん) Generation Gapパターン Hook Operationパターン Hook OperationパターンRuby版 (by 助田雅紀さん) Immutableパターン Marker Interfaceパターン Monostateパターン MonostateパターンRuby版 (by 助田雅紀さん) MonostateパターンPerl版 (by 宮川さん) Null Objectパターン Null ObjectパターンとSingletonパターン Producer-Consumerパターン Sharableパターン Singl
先日のMVCの議論の際には、私自身いろいろと勉強させていただいたが、少し心配になったのは、「MVCの定義だって時代とともに変わる」「ウェブサービス用のMVCはSmalltalk時代のMVCとは異なるもの」「MVCなんか理解してなくてもアプリケーションが作れればいいじゃん」など、そもそも「MVCとは何か」どころか「デザイン・パターンとは何か」を理解していないんじゃないかと思われる発言が見られたこと。ということで、今日はデザイン・パターンについてひと言。 デザイン・パターンとは、(業界に蓄積されたノウハウに立脚した)何かを作る際の指針のこと。ソフトウェアに限らず、ものを作るときにはさまざまな(場合によってはお互いに矛盾する)要求条件や制約が課せられるわけだが、そんな時に過去にさまざまな事例を解決してきた先人の知恵を「パターン化」してノウハウとして身につけておけば、似たような事例に出会った時に効
Index¶ This is a collection of patterns which we have found occuring commonly with Django. All of these either make collaboration easier, coding simpler or code more maintainable. None of them are design patterns in the sense of GoF design patterns. We call them design patterns as none other seem closer or more convinient. These are guidelines, which need to be overriden (very commonly, in some ca
_ 5年後に後悔しないJavaプログラムの書き方 ここ数日、死ぬほど後悔しまくっているので、あらためて(というのは、数年前にも一度後悔しまくって、そのときの知見はあらかた処方箋とかコーディングの掟に書いているからだが)後悔しないための書き方をいくつか紹介する。 とにかく、ファクトリメソッドパターンを使うこと。 これは本当に重要。しかも簡単でありながら効果は絶大。 だめな例。 public class FooBar { private Connection conn; ... protected void setup() { ... conn = DriverManager.getConnection(url); ... } urlを指定することや、DriverManagerの実装を交換すれば良いだろうと想定していても(というか、Connectionならそういう方法もあり得るが、そうはいかな
Please consider subscribing to LWNSubscriptions are the lifeblood of LWN.net. If you appreciate this content and would like to see more of it, your subscription will help to ensure that LWN continues to thrive. Please visit this page to join up and keep LWN on the net. One of the topics of ongoing interest in the kernel community is that of maintaining quality. It is trivially obvious that we need
まだ読んでないけど、プログラミング界の戦略サファリかと思いきや、新しい視点の提案なのかな? Stevey's Blog Rants: The Universal Design Pattern With this context in mind, I claim that the Properties Pattern is yet another kind of domain modeling, with its own unique strengths and tradeoffs, distinct from all the other modeling schools I've mentioned. At a high level, every implementation of the Properties Pattern has the same core API. It's the
Template Methodパターンの例 デザインパターンは強力なツールです。強力なツールには常に誤用の可能性があります。注意を怠ると、ぐちゃぐちゃで何だかよくわからないものを作ってしまったりする危険性があります。 Template Methodは、2つ以上の関連するクラスの間での重複をなくすための、1つの解決策を提供するデザインパターンです。これはGammaらによる『Design Patterns』(1995年)で取り上げられていた23個のパターンのうちの1つです。 Template Methodパターンはリファクタリングの目標と考えるのがよいでしょう。本稿では、この目標に向けてコードを手直しする方法を、具体的な例を見ながら説明していきます。「Template Methodパターンとは何ぞや」ではなく、実際にリファクタリングを行い、その結果について語ることにします。 今回のサンプルでは
Adapterパターンの例 Portfolioクラスは、ユーザーの株式購入履歴を追跡するアプリケーションの基礎となるものです。当然ながら、ポートフォリオに最も求められる機能は、これらの株式購入の価値を計算することです。 PortfolioTestクラス(リスト1を参照)は、Portfolioクラスが値を正しく取得できることを検証するのに役立つ単純なスタブの使用例を示しています。Portfolioクラス(リスト2を参照)は、StockLookupServiceインターフェイスを通じて呼び出しを行うことで、各シンボルの価格を取得します。StockLookupServiceのしくみは単純です。このサービスは、株式シンボルが与えられると、そのシンボルの現在のドル価格を返します。StockLookupServiceインターフェイスの定義は次のとおりです。 import static org.juni
Based on the same architectural pattern of the web, "REST" has a growing dominance of the SOA (Service Oriented Architecture) implementation these days. In this article, we will discuss some basic design principles of REST. SOAP : The Remote Procedure Call ModelBefore the REST become a dominance, most of SOA architecture are built around WS* stack, which is fundamentally a RPC (Remote Procedure Ca
Python Design Patterns Alex Martelli Design Patterns must be studied in the context on the language in which they'll get implemented -- the Gang of Four made that point strongly in their book, though almost everybody else seems not to have noticed. This talk explores some "classic" DPs in all the various categories -- Creational, Structural, and Behavioral -- studying how they show up in Python
リリース、障害情報などのサービスのお知らせ
最新の人気エントリーの配信
処理を実行中です
j次のブックマーク
k前のブックマーク
lあとで読む
eコメント一覧を開く
oページを開く