God object

God object

God object (deutsch: "Gott-Objekt"; auch: god class bzw. deutsch: Gottklasse) bezeichnet in der objektorientierten Programmierung ein Objekt, das "zu viel weiß" oder "zu viel tut". Das God object ist ein Beispiel für ein Anti-Pattern.

Die grundlegende Idee der strukturierten Programmierung besteht darin, dass große Probleme in eine Vielzahl kleinerer Probleme zerlegt werden, um für diese jeweils Lösungen zu finden. Das Lösen der kleinen Probleme bedeutet gleichsam die Lösung des großen Problems. Daher muss ein jedes Objekt nur über sich selbst wirklich alles wissen, weniger über die anderen; ebenso hat es nur sein eigenes Problem zu lösen, nicht die der anderen Objekte.

Codes, welche auf God-objects basieren, folgen nicht diesem Paradigma. Stattdessen ist ein Großteil der Funktionalität eines Programms in einem einzigen Objekt hinterlegt. Da dieses Objekt so viele Daten und Methoden beinhaltet, wird seine Bedeutung innerhalb des Programms nahezu allumfassend (gottähnlich).

Die einzelnen Objekte kommunizieren also nicht direkt miteinander, sondern sind von dem einen God object abhängig. Da das God object derart stark mit dem übrigen Code referenziert ist, wird die Wartung des Programms, resp. des Objekts, sehr schwierig, was den Anforderungen der Objektorientierung sowie der strukturierten Programmierung nicht gerecht wird.

Die Verwendung eines God object innerhalb der objektorientierten Programmierung entspricht also systematisch dem mangelhaften Gebrauch von Subroutinen oder der übermäßigen Verwendung globaler Variablen in der prozeduralen Programmierung.

Während ein God object generell als Merkmal eines schwachen Programmaufbaus gilt, ist es gängige Praxis innerhalb begrenzter Umgebungen wie dem Mikrocontroller, bei dem eine schnelle Performance wichtiger ist als die Wartung. Da jedoch auch Mikrocontroller immer leistungsfähiger werden, dürfte diesem Argument immer weniger Bedeutung zukommen.

Big hairy object

Ein ähnlicher, oft synonym gebrauchter Slang- Begriff ist der des Big hairy object. Als wesentlicher Unterschied wird hingegen angeführt, dass das Big hairy object, im Gegensatz zum God object, nicht die Kontrolle über das Programm übernimmt, sondern lediglich eine überladene Schnittstelle darstellt.


Wikimedia Foundation.

Игры ⚽ Поможем написать реферат

Schlagen Sie auch in anderen Wörterbüchern nach:

  • God object — In object oriented programming, a God object is an object that knows too much or does too much. The God object is an example of an anti pattern. The basic idea behind structured programming is that a big problem is broken down into several… …   Wikipedia

  • God object — Un God object ou objet omniscient est, dans le domaine de la programmation orientée objet, un objet qui reconnaît trop de choses ou fait trop de choses. Le god object est un exemple d antipattern (ou anti patron). Sommaire 1 Description 2 Notes… …   Wikipédia en Français

  • Object (computer science) — In computer science, an object is any entity that can be manipulated by the commands of a programming language, such as a value, variable, function, or data structure. (With the later introduction of object oriented programming the same word,… …   Wikipedia

  • God — (g[o^]d), n. [AS. god; akin to OS. & D. god, OHG. got, G. gott, Icel. gu[eth], go[eth], Sw. & Dan. gud, Goth. gup, prob. orig. a p. p. from a root appearing in Skr. h[=u], p. p. h[=u]ta, to call upon, invoke, implore. [root]30. Cf. {Goodbye},… …   The Collaborative International Dictionary of English

  • God's acre — God God (g[o^]d), n. [AS. god; akin to OS. & D. god, OHG. got, G. gott, Icel. gu[eth], go[eth], Sw. & Dan. gud, Goth. gup, prob. orig. a p. p. from a root appearing in Skr. h[=u], p. p. h[=u]ta, to call upon, invoke, implore. [root]30. Cf.… …   The Collaborative International Dictionary of English

  • God's field — God God (g[o^]d), n. [AS. god; akin to OS. & D. god, OHG. got, G. gott, Icel. gu[eth], go[eth], Sw. & Dan. gud, Goth. gup, prob. orig. a p. p. from a root appearing in Skr. h[=u], p. p. h[=u]ta, to call upon, invoke, implore. [root]30. Cf.… …   The Collaborative International Dictionary of English

  • God's house — God God (g[o^]d), n. [AS. god; akin to OS. & D. god, OHG. got, G. gott, Icel. gu[eth], go[eth], Sw. & Dan. gud, Goth. gup, prob. orig. a p. p. from a root appearing in Skr. h[=u], p. p. h[=u]ta, to call upon, invoke, implore. [root]30. Cf.… …   The Collaborative International Dictionary of English

  • God's penny — God God (g[o^]d), n. [AS. god; akin to OS. & D. god, OHG. got, G. gott, Icel. gu[eth], go[eth], Sw. & Dan. gud, Goth. gup, prob. orig. a p. p. from a root appearing in Skr. h[=u], p. p. h[=u]ta, to call upon, invoke, implore. [root]30. Cf.… …   The Collaborative International Dictionary of English

  • God's Sunday — God God (g[o^]d), n. [AS. god; akin to OS. & D. god, OHG. got, G. gott, Icel. gu[eth], go[eth], Sw. & Dan. gud, Goth. gup, prob. orig. a p. p. from a root appearing in Skr. h[=u], p. p. h[=u]ta, to call upon, invoke, implore. [root]30. Cf.… …   The Collaborative International Dictionary of English

  • God — /god/, n., v., godded, godding, interj. n. 1. the one Supreme Being, the creator and ruler of the universe. 2. the Supreme Being considered with reference to a particular attribute: the God of Islam. 3. (l.c.) one of several deities, esp. a male… …   Universalium

Share the article and excerpts

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