Balking pattern

Balking pattern

The Balking pattern is a software design pattern that only executes an action on an object when the object is in a particular state. For example, if an object reads ZIP files and a calling method invokes a get method on the object when the ZIP file is not open, the object would "balk" at the request. In the Java programming language, for example, an IllegalStateException might be thrown under these circumstances.

There are some in this field that think this is more of an Anti-Pattern, than a design pattern. If an object cannot support its API, it should either limit the API so that the offending call is not available or it should …
* be created in a sane state
* not make itself available until it is in a sane state
* become a façade and answer back an object that is in a sane state… so that the call can be made without limitation.

ee also

*Read and write lock pattern
*Guarded suspension pattern


Wikimedia Foundation. 2010.

Игры ⚽ Поможем решить контрольную работу

Look at other dictionaries:

  • Concurrency pattern — In software engineering, concurrency patterns are those types of design patterns that deal with multi threaded programming paradigm. Examples of this class of patterns include: Active Object[1][2] Balking pattern Double checked locking pattern… …   Wikipedia

  • Read/write lock pattern — A read/write lock pattern or simply RWL is a software design pattern that allows concurrent read access to an object but requires exclusive access for write operations.In this pattern, multiple readers can read the data in parallel but an… …   Wikipedia

  • Software design pattern — In software engineering, a design pattern is a general reusable solution to a commonly occurring problem within a given context in software design. A design pattern is not a finished design that can be transformed directly into code. It is a… …   Wikipedia

  • Шаблон проектирования — У этого термина существуют и другие значения, см. Паттерн. В разработке программного обеспечения, шаблон проектирования или паттерн (англ. design pattern) повторимая архитектурная конструкция, представляющая собой решение проблемы… …   Википедия

  • Guarded suspension — In concurrent programming, guarded suspension [cite book|last=Lea first=Doug authorlink=Doug Lea title=Concurrent Programming in Java Second Edition publisher=Addison Wesley location=Reading, MA year=2000 id = ISBN 0 201 31009 0] is a software… …   Wikipedia

  • Readers–writer lock — In computer science, a readers writer or shared exclusive lock (also known as the multiple readers / single writer lock[1] or the multi reader lock,[2] or by typographical variants such as readers/writers lock) is a synchronization primitive that …   Wikipedia

  • United States — a republic in the N Western Hemisphere comprising 48 conterminous states, the District of Columbia, and Alaska in North America, and Hawaii in the N Pacific. 267,954,767; conterminous United States, 3,022,387 sq. mi. (7,827,982 sq. km); with… …   Universalium

  • Business and Industry Review — ▪ 1999 Introduction Overview        Annual Average Rates of Growth of Manufacturing Output, 1980 97, Table Pattern of Output, 1994 97, Table Index Numbers of Production, Employment, and Productivity in Manufacturing Industries, Table (For Annual… …   Universalium

  • President of the United States — POTUS redirects here. For political talk radio, see P.O.T.U.S. (Sirius XM). For other uses, see President of the United States (disambiguation). For a list, see List of Presidents of the United States. President of the United States of America …   Wikipedia

  • Шаблоны проектирования — (паттерн, англ. design pattern) это многократно применяемая архитектурная конструкция, предоставляющая решение общей проблемы проектирования в рамках конкретного контекста и описывающая значимость этого решения. Паттерн не является законченным… …   Википедия

Share the article and excerpts

Direct link
Do a right-click on the link above
and select “Copy Link”