ラベル 暗記 の投稿を表示しています。 すべての投稿を表示
ラベル 暗記 の投稿を表示しています。 すべての投稿を表示

2014年4月4日金曜日

PoEAA のパターン一覧を頭に入れなおしてみる

『Patterns of Enterprise Application Architecture』 と言えば、2000年代前半の パターン本の金字塔と言われていて、今でもいろんな文献で引用されていたりする。

ただ、だいぶ昔に一通り読んではいるものの、使っていないパターンなどで忘れていたりしているものも多くて、最近の本とか論文とかを読んでいるときに出くわしたりすると、とっさに思い出せない事がある。

というわけで今更だけど、最低限パターン名と概要だけでも、この際いったん全部頭に入れてしまおう思い、以下の暗記カードを作った。

邦訳本も一応出版されているけど、パターン名が原語のそれと全然違っていたりして、あまり評判もよくないので、原書の記述に基づいて作った。

PoEAA のパターン一覧を覚えてみる
{ "height":200, "width":400, "opacity":0.9, "start-color":"#000000", "start-bg-color":"#FEFFFE", "question-color":"#002200", "question-bg-color":"#FEFFFE", "statusbar-bg-color":"#FEFFFE", "statusbar-color":"#000000", "last-bg-color":"#FEFFFE", "last-color":"#002200", "answer-color":"#0044AA", "answer-bg-color":"#FEFFFE", "button-color":"#FEFFFE", "caption":"PoEAA のパターン一覧を覚えてみる", "caption-color":"#CCEEFF", }
以下の記述が示すPoEAAパターン名は何か?
Organizes business logic by procedures where each procedure handles a single request from the presentation.
Transaction Script
以下の記述が示すPoEAAパターン名は何か?
An object model of the domain that incorporates both behavior and data.
Domain Model
以下の記述が示すPoEAAパターン名は何か?
A single instance that handles the business logic for all rows in a database table or view.
Table Module
以下の記述が示すPoEAAパターン名は何か?
Defines an application's boundary with a layer of services that establishes a set of available operations and coordinates the application's response in each operation.
Service Layer
以下の記述が示すPoEAAパターン名は何か?
An object that acts as a Gateway to a database table. One instance handles all the rows in the table.
Table Data Gateway
以下の記述が示すPoEAAパターン名は何か?
An object that acts as a Gateway to a single record in a data source. There is one instance per row.
Row Data Gateway
以下の記述が示すPoEAAパターン名は何か?
An object that wraps a row in a database table or view, encapsulates the database access, and adds domain logic on that data.
Active Record
以下の記述が示すPoEAAパターン名は何か?
A layer of Mappers that moves data between objects and a database while keeping them independent of each other and the mapper itself.
Data Mapper
以下の記述が示すPoEAAパターン名は何か?
Maintains a list of objects affected by a business transaction and coordinates the writing out of changes and the resolution of concurrency problems.
Unit of Work
以下の記述が示すPoEAAパターン名は何か?
Ensures that each object gets loaded only once by keeping every loaded object in a map. Looks up objects using the map when referring to them.
Identity Map
以下の記述が示すPoEAAパターン名は何か?
An object that doesn't contain all of the data you need but knows how to get it.
Lazy Load
以下の記述が示すPoEAAパターン名は何か?
Saves a database ID field in an object to maintain identity between an in-memory object and a database row.
Identity Field
以下の記述が示すPoEAAパターン名は何か?
Maps an association between objects to a foreign key reference between tables.
Foreign Key Mapping
以下の記述が示すPoEAAパターン名は何か?
Saves an association as a table with foreign keys to the tables that are linked by the association.
Association Table Mapping
以下の記述が示すPoEAAパターン名は何か?
Has one class perform the database mapping for a child class.
Dependent Mapping
以下の記述が示すPoEAAパターン名は何か?
Maps an object into several fields of another object's table.
Embedded Value
以下の記述が示すPoEAAパターン名は何か?
Saves a graph of objects by serializing them into a single large object (LOB), which it stores in a database field.
Serialized LOB
以下の記述が示すPoEAAパターン名は何か?
Represents an inheritance hierarchy of classes as a single table that has columns for all the fields of the various classes.
Single Table Inheritance
以下の記述が示すPoEAAパターン名は何か?
Represents an inheritance hierarchy of classes with one table for each class.
Class Table Inheritance
以下の記述が示すPoEAAパターン名は何か?
Represents an inheritance hierarchy of classes with one table per concrete class in the hierarchy.
Concrete Table Inheritance
以下の記述が示すPoEAAパターン名は何か?
A structure to organize database mappers that handle inheritance hierarchies.
Inheritance Mappers
以下の記述が示すPoEAAパターン名は何か?
Holds details of object-relational mapping in metadata.
Metadata Mapping
以下の記述が示すPoEAAパターン名は何か?
An object that represents a database query.
Query Object
以下の記述が示すPoEAAパターン名は何か?
Mediates between the domain and data mapping layers using a collection-like interface for accessing domain objects.
Repository
以下の記述が示すPoEAAパターン名は何か?
Splits user interface interaction into three distinct roles.
Model View Controller
以下の記述が示すPoEAAパターン名は何か?
An object that handles a request for a specific page or action on a Web site.
Page Controller
以下の記述が示すPoEAAパターン名は何か?
A controller that handles all requests for a Web site.
Front Controller
以下の記述が示すPoEAAパターン名は何か?
Renders information into HTML by embedding markers in an HTML page.
Template View
以下の記述が示すPoEAAパターン名は何か?
A view that processes domain data element by element and transforms it into HTML.
Transform View
以下の記述が示すPoEAAパターン名は何か?
Turns domain data into HTML in two steps: first by forming some kind of logical page, then rendering the logical page into HTML.
Two Step View
以下の記述が示すPoEAAパターン名は何か?
A centralized point for handling screen navigation and the flow of an application.
Application Controller
以下の記述が示すPoEAAパターン名は何か?
Provides a coarse-grained facade on fine-grained objects to improve efficiency over a network.
Remote Facade
以下の記述が示すPoEAAパターン名は何か?
An object that carries data between processes in order to reduce the number of method calls.
Data Transfer Object
以下の記述が示すPoEAAパターン名は何か?
Prevents conflicts between concurrent business transactions by detecting a conflict and rolling back the transaction.
Optimistic Offline Lock
以下の記述が示すPoEAAパターン名は何か?
Prevents conflicts between concurrent business transactions by allowing only one business transaction at a time to access data.
Pessimistic Offline Lock
以下の記述が示すPoEAAパターン名は何か?
Locks a set of related objects with a single lock.
Coarse-Grained Lock
以下の記述が示すPoEAAパターン名は何か?
Allows framework or layer supertype code to acquire offline locks.
Implicit Lock
以下の記述が示すPoEAAパターン名は何か?
Stores session state on the client.
Client Session State
以下の記述が示すPoEAAパターン名は何か?
Keeps the session state on a server system in a serialized form.
Server Session State
以下の記述が示すPoEAAパターン名は何か?
Stores session data as committed data in the database.
Database Session State
以下の記述が示すPoEAAパターン名は何か?
An object that encapsulates access to an external system or resource.
Gateway
以下の記述が示すPoEAAパターン名は何か?
An object that sets up a communication between two independent objects.
Mapper
以下の記述が示すPoEAAパターン名は何か?
A type that acts as the supertype for all types in its layer.
Layer Supertype
以下の記述が示すPoEAAパターン名は何か?
Defines an interface in a separate package from its implementation.
Separated Interface
以下の記述が示すPoEAAパターン名は何か?
A well-known object that other objects can use to find common objects and services.
Registry
以下の記述が示すPoEAAパターン名は何か?
A small simple object, like money or a date range, whose equality isn't based on identity.
Value Object
以下の記述が示すPoEAAパターン名は何か?
Represents a monetary value.
Money
以下の記述が示すPoEAAパターン名は何か?
A subclass that provides special behavior for particular cases.
Special Case
以下の記述が示すPoEAAパターン名は何か?
Links classes during configuration rather than compilation.
Plugin
以下の記述が示すPoEAAパターン名は何か?
Removes dependence upon problematic services during testing.
Service Stub
以下の記述が示すPoEAAパターン名は何か?
An in-memory representation of tabular data.
Record Set
この作業やってて、パターン名だけは一応なんとか見覚えがあっても、内容がよく思い出せないのが、3分の2くらいもあった。

まあ印象が薄いのは、そもそもあまり重要でないパターンだったのかもしれないけど、名称と概要くらいなら、いつでも取り出せる形で、脳内の引き出しに入れておいても邪魔にはならないだろう。

2012年11月4日日曜日

Domain-Driven Design の暗記事項(1)

この際、DDD本の見返しの、パターン関連図を暗記してしまおうと思う。

丸暗記ってそれ自体が批判される事が多いけど、広さ方向の知識に関しては暗記は有効だと自分は思う。もちろん深さ方向の知識のための、精読と実践も並行するのが前提だけど、両方やってく事で、知識の量が上手く増えていくと思うんだな。

つうわけで、2・3年前に JavaScript で書いた暗記用のツールを再利用してみた。問題データを<div>で書いて、これを JavaScript で読み込んでアプレット風のものに表示するようにしている。JavaScript 自体よりBlogger に組み込むのがちょっと苦心した覚えがある。

ちなみにIEについては、6で動かず、7以上でも色設定が想定通りにならないが、気にしないことにした。

DDD のパターン同士の関連を覚えてみる
{ "height":200, "width":400, "opacity":0.9, "start-color":"#000000", "start-bg-color":"#FEFFFE", "question-color":"#002200", "question-bg-color":"#FEFFFE", "statusbar-bg-color":"#FEFFFE", "statusbar-color":"#000000", "last-bg-color":"#FEFFFE", "last-color":"#002200", "answer-color":"#0044AA", "answer-bg-color":"#FEFFFE", "button-color":"#FEFFFE", "caption":"DDD のパターン同士の関連を覚えてみる", "caption-color":"#CCEEFF", }
*(1)* reduce cost of change with Conceptual Contours
Model-Driven Design
*(1)* simplify interpretation with Standalone Classes
Model-Driven Design
*(1)* express model through Intention-Revealing Interfaces
Model-Driven Design
*(1)* isolate domain with Layered Architecture
Model-Driven Design
*(1)* express model as Modules
Model-Driven Design
*(1)* express model as Entities
Model-Driven Design
*(1)* express model as Value Objects
Model-Driven Design
*(1)* express model as Services
Model-Driven Design
*(1)* model out loud Model-Driven Design
Ubiquitous Language
*(1)* make composition safe Assertions
Side-Effect-Free Functions
*(1)* make side effects explict with Assertions
Intention-Revealing Interfaces
*(1)* make safe and simple Side-Effect-Free Functions
Intention-Revealing Interfaces
*(5)* names enter Ubiquitous Language
Services
Value Objects
Entities
Modules
Bounded Context
*(2)* encapsulate with Factories
Value Objects
Aggregates
*(2)* encapsulate with Aggregates
Value Objects
Entities
*(1)* maintain integrity with Aggregates
Entities
*(2)* access with Repositories
Entities
Aggregates
*(2)* distill to Declarative Style
Generic Subdomains
Segregated Core
*(1)* point the way with Domain Vision Statement
Core Domain
*(1)* unencumber from Generic Subdomains
Core Domain
*(1)* repackage into Segregated Core
Core Domain
*(1)* emphasize in Ubiquitous Language
Core Domain
*(1)* relate disparate parts with Context Map
Core Domain
*(1)* concepts enter Core Domain
Evolving Order
*(1)* structure carried in Ubiquitous Language
Evolving Order
*(1)* keep unified by Continuous Integration
Bounded Context
*(2)* structure through Evolving Order
Context Map
Core Domain
Model-Driven Design reduce cost of change with *(1)*
Conceptual Contours
Model-Driven Design simplify interpretation with *(1)*
Standalone Classes
Model-Driven Design express model through *(1)*
Intention-Revealing Interfaces
Model-Driven Design isolate domain with *(1)*
Layered Architecture
Model-Driven Design express model as *(4)*
Modules
Entities
Value Objects
Services
Ubiquitous Language model out loud *(1)*
Model-Driven Design
Side-Effect-Free Functions make composition safe *(1)*
Assertions
Intention-Revealing Interfaces make side effects explict with *(1)*
Assertions
Intention-Revealing Interfaces make safe and simple *(1)*
Side-Effect-Free Functions
Services names enter *(1)*
Ubiquitous Language
Value Objects names enter *(1)*
Ubiquitous Language
Value Objects encapsulate with *(2)*
Factories
Aggregates
Entities names enter *(1)*
Ubiquitous Language
Entities encapsulate with *(1)*
Aggregates
Entities maintain integrity with *(1)*
Aggregates
Entities access with *(1)*
Repositories
Modules names enter *(1)*
Ubiquitous Language
Aggregates encapsulate with *(1)*
Factories
Aggregates access with *(1)*
Repositories
Generic Subdomains distill to *(1)*
Declarative Style
Segregated Core distill to *(1)*
Declarative Style
Core Domain point the way with *(1)*
Domain Vision Statement
Core Domain unencumber from *(1)*
Generic Subdomains
Core Domain repackage into *(1)*
Segregated Core
Core Domain emphasize in *(1)*
Ubiquitous Language
Core Domain relate disparate parts with *(1)*
Context Map
Core Domain structure through *(1)*
Evolving Order
Evolving Order concepts enter *(1)*
Core Domain
Evolving Order structure carried in *(1)*
Ubiquitous Language
Bounded Context names enter *(1)*
Ubiquitous Language
Bounded Context keep unified by *(1)*
Continuous Integration
Context Map structure through *(1)*
Evolving Order

覚えたら問題をもっと増やしていこうと思う。

2009年8月4日火曜日

暗記帳

感覚的には余りブラウザアプリは好きじゃなくて、選択の余地があれば JavaScript/DHTML/Ajax よりも専用アプリとか専ブラに傾く感じなんだけど、かなり前からJavaScriptスキルの価値が高まってきているので、やや遅まきながら準備しておく事にした。

勉強のテーマとして捉えると、多分、余り面白くはなさそうな気配というか、逆にかなりイライラしそうな気配が最初からあるので、題材としてちょっと実用的で使って役に立つものを目指して面倒臭さを克服してみる。

以下のようなアプレット様の暗記帳を、JavaScript で作ってみた。
BMM の基本要素
{ "height":200, "width":400, "caption":"暗記帳 アルファ版" }
Meansの直下のBMM要素は?
  • Mission
  • Strategy
  • Tactic
Endsの直下のBMM要素は?
要素数は3個
  • Vision
  • Goal
  • Objective

JavaScriptファイルは別のサーバにおいてある。このブログの JavaScriptコードでは、単にそのJavaScriptファイル中の関数を window の onload イベントで実行するようにリスナを追加するだけ。

このコードは、div タグで構成した以下のような暗記帳データを読み込み、動的にJavaScriptアプレットを生成、暗記帳の出題と解のペアを保持する。実際は改行や余計な空白を取り除いておく必要がある。
<div id="div1" class="memorizer">
  <div class="memo_title">BMM の基本要素</div>
  <div class="memo_config">
    { "height":200,
      "width":400,
      "caption":"暗記帳 アルファ版"
    }
  </div>
  <div class="memo_dataPart">
    <div class="pair">
      <div class="question">Meansの直下のBMM要素は&#65311;</div>
        <div class="answer">
          <ul style="margin-top:0px;">
            <li>Mission</li>
            <li>Strategy</li>
            <li>Tactic</li>
          </ul>
        </div>
      </div>
      <div class="pair">
        <div class="question">Endsの直下のBMM要素は&#65311;</div>
        <div class="hint">要素数は3個</div>
        <div class="answer">
          <ul>
            <li>Vision</li>
            <li>Goal</li>
            <li>Objective</li>
          </ul>
        </div>
      </div>
    </div>
</div>


FireFox 3、InternetExplorer 8、Opera 9、Safari 4で動作確認した。ちょっと見た目が違うところがあるが妥協。

◆今後の課題
  • 複数のアプレットがある場合に全部を解釈するまでスレッドを占有したりしないように、一個ずつブラウザに処理をもどす。
  • 終了ページで「1回目:n問中m問、2回目:n-m問中l問」という形でレポートを表示する
  • コードが汚いのでリファクタ。もうちょっとオシャレなJavaScriptイディオムがかけないとだめ。
  • CSS 関連の知識不足から、現状のコードではたまたま動いているところや、冗長な設定があるはず。必要十分なコードを追求する。
  • エラーハンドリング
  • スピードアップ、効率化

※それにしても、ある程度予想していたがクロスブラウザがこれほど面倒くさいとは。IE の「"colSpan"がOKで、"colspan"がダメ」とか透明の指定法とかって・・・テンション下がるわ。