Skip to content

Commit 624e970

Browse files
authored
Translate README.md for Abstract Document to German
1 parent e71866f commit 624e970

1 file changed

Lines changed: 49 additions & 51 deletions

File tree

localization/de/abstract-factory/README.md

Lines changed: 49 additions & 51 deletions
Original file line numberDiff line numberDiff line change
@@ -20,31 +20,30 @@ Das Abstract-Factory-Pattern stellt ein Interface zum Erzeugen von Instanzen ein
2020
ähnlicher oder voneinander abhängiger Objekte zur Verfügung, ohne dass dabei deren konkrete Klasse
2121
festgelegt ist. Damit werden Modularität und Flexibilität im Softwaredesign verbessert.
2222

23-
## Detailed Explanation of Abstract Factory Pattern with Real-World Examples
23+
## Detaillierte Erklärung
24+
Reales Beispiel
2425

25-
Real-world example
26-
27-
> Imagine a furniture company that uses the Abstract Factory pattern in Java to produce various styles of furniture: modern, Victorian, and rustic. Each style includes products like chairs, tables, and sofas. To ensure consistency within each style, the company uses an Abstract Factory pattern.
26+
> Stellen Sie sich einen Möbelhersteller vor, der Möbelstücke in verschiedenen Stilen anbietet, z.B. modern, viktorianisch, rustikal. Zu jedem Stil gibt es Produkte wie Stühle, Tische und Sessel. Um Produkte unabhängig vom Stil einheitlich verwalten zu können, wird das Abstract-Factory-Pattern eingesetzt.
2827
>
29-
> In this scenario, the Abstract Factory is an interface for creating families of related furniture objects (chairs, tables, sofas). Each concrete factory (ModernFurnitureFactory, VictorianFurnitureFactory, RusticFurnitureFactory) implements the Abstract Factory interface and creates a set of products that match the specific style. This way, clients can create a whole set of modern or Victorian furniture without worrying about the details of their instantiation. This maintains a consistent style and allows easy swapping of one style of furniture for another.
28+
> Dabei ist die Abstract Factory ein Interface, mit dem mehrere Familien zusammengehöriger Möbelstücke (Stühle, Tische, Sessel) erzeugt werden. Jede einzelne konkrete Factory (ModernFurnitureFactory, VictorianFurnitureFactory, RusticFurnitureFactory) implementiert dieses Interface und erzeugt Möbelstücke des jeweiligen Stils. Auf diese Weise können ganze Einrichtungen in einem bestimmten Stil produziert werden, ohne dass man sich um die Details der Instantiierung kümmern muss. Das erlaubt eine einheitliche Bearbeitung und einen einfachen Wechsel des Einrichtungsstils.
3029
31-
In plain words
30+
In einfachen Worten
3231

33-
> A factory of factories; a factory that groups the individual but related/dependent factories together without specifying their concrete classes.
32+
> Eine Factory für Factories - eine Factory, die mehrere zusammengehörende Factories vereinigt, ohne die konkrete Klasse der Objekte festzulegen.
3433
35-
Wikipedia says
34+
Wikipedia sagt
3635

37-
> The abstract factory pattern provides a way to encapsulate a group of individual factories that have a common theme without specifying their concrete classes
36+
> Das Abstract-Factory-Pattern dient zur Kapselung einer Gruppe einzelner Factories mit gemeinsamem Thema, wobei deren konkrete Klassse variabel bleibt.
3837
39-
Class diagram
38+
Klassendiagramm
4039

4140
![Abstract Factory class diagram](./etc/abstract-factory.urm.png "Abstract Factory class diagram")
4241

43-
## Programmatic Example of Abstract Factory in Java
42+
## Programmbeispiel
4443

45-
To create a kingdom using the Abstract Factory pattern in Java, we need objects with a common theme. The elven kingdom needs an elven king, elven castle, and elven army whereas the orcish kingdom needs an orcish king, orcish castle, and orcish army. There is a dependency between the objects in the kingdom.
44+
Um ein Königreich mit dem Abstract-Factory-Pattern zu erzeugen, brauchen wir ein gemeinsames Thema. Das Elben-Königreich hat einen Elbenkönig, ein Elbenschlos und eine Elbenarmee, das Ork-Königreich dagegen einen Orkkönig, ein Orkschloss und eine Orkarmee. Die Objekte des jeweiligen Königreichs hängen voneinander ab.
4645

47-
Translating the kingdom example above. First of all, we have some interfaces and implementation for the objects in the kingdom.
46+
Zunächst definieren wir die Interfaces und implementieren sie für die einzelnen Königreiche.
4847

4948
```java
5049
public interface Castle {
@@ -59,7 +58,7 @@ public interface Army {
5958
String getDescription();
6059
}
6160

62-
// Elven implementations ->
61+
// Elben-Implementationen ->
6362
public class ElfCastle implements Castle {
6463
static final String DESCRIPTION = "This is the elven castle!";
6564

@@ -87,10 +86,10 @@ public class ElfArmy implements Army {
8786
}
8887
}
8988

90-
// Orcish implementations similarly -> ...
89+
// Ork-Implementations analog -> ...
9190
```
9291

93-
Then we have the abstraction and implementations for the kingdom factory.
92+
Nun kommt das Interface für die Königreich-Factory und seine Implementationen.
9493

9594
```java
9695
public interface KingdomFactory {
@@ -119,10 +118,10 @@ public class ElfKingdomFactory implements KingdomFactory {
119118
}
120119
}
121120

122-
// Orcish implementations similarly -> ...
121+
// Ork-Implementationen analog -> ...
123122
```
124123

125-
Now, we can design a factory for our different kingdom factories. In this example, we created `FactoryMaker`, responsible for returning an instance of either `ElfKingdomFactory` or `OrcKingdomFactory`. The client can use `FactoryMaker` to create the desired concrete factory which, in turn, will produce different concrete objects (derived from `Army`, `King`, `Castle`). In this example, we also used an enum to parameterize which type of kingdom factory the client will ask for.
124+
Jetzt können wir eine Factory bauen, die eine Instanz von entweder `ElfKingdomFactory` oder `OrcKingdomFactory` erstellt. Diese nennen wir `FactoryMaker`. Der Client kann `FactoryMaker` verwenden, um die gewünschte Factory zu erzeugen, mit der dann wiederum konkrete Objekte (abgeleitet von `Army`, `King`, `Castle`) erzeugt werden können. In diesem Beispiel nutzen wir ein Enum als Parameter für die gewünschte Art der Factory.
126125

127126
```java
128127
public static class FactoryMaker {
@@ -140,7 +139,7 @@ public static class FactoryMaker {
140139
}
141140
```
142141

143-
Here is the main function of our example application:
142+
Hier die main-Methode der Beispielanwendung:
144143

145144
```java
146145
LOGGER.info("elf kingdom");
@@ -156,7 +155,7 @@ LOGGER.info(kingdom.getCastle().getDescription());
156155
LOGGER.info(kingdom.getKing().getDescription());
157156
```
158157

159-
The program output:
158+
Ausgabe:
160159

161160
```
162161
07:35:46.340 [main] INFO com.iluwatar.abstractfactory.App -- elf kingdom
@@ -169,57 +168,56 @@ The program output:
169168
07:35:46.343 [main] INFO com.iluwatar.abstractfactory.App -- This is the orc king!
170169
```
171170

172-
## When to Use the Abstract Factory Pattern in Java
173-
174-
Use the Abstract Factory pattern in Java when:
171+
## Verwendung
175172

176-
* The system should be independent of how its products are created, composed, and represented.
177-
* You need to configure the system with one of multiple families of products.
178-
* A family of related product objects must be used together, enforcing consistency.
179-
* You want to provide a class library of products, exposing only their interfaces, not their implementations.
180-
* The lifetime of dependencies is shorter than the consumer's lifetime.
181-
* Dependencies need to be constructed using runtime values or parameters.
182-
* You need to choose which product to use from a family at runtime.
183-
* Adding new products or families should not require changes to existing code.
173+
Einsatzkriterien für Abstract Factory:
174+
* Das System sollte nicht davon abhängig sein, wie die Produkte erzeugt, zusammengesetzt und dargestellt werden.
175+
* Nötige Konfiguration für eine oder mehrere Produktfamilien.
176+
* Eine Familie ähnlicher Produkte muss gemeinsam auf gleiche Art genutzt werden.
177+
* Die Klassenbibliothek der Produkte zeigt dem Anwender nur ihre Interfaces, nicht ihre Implementation.
178+
* Abhängigkeiten zwischen den Produkten existieren kürzer als die Verwendung dauert.
179+
* Abhängigkeiten müssen zur Laufzeit durch Parameter konstruiert werden.
180+
* Zur Laufzeit wird ein Produkt aus einer Familie ausgewählt.
181+
* Keine Code-Änderungen bei Hinzufügen weiterer Familien oder Produkte.
184182

185-
## Abstract Factory Pattern Java Tutorials
183+
## Tutorials
186184

187185
* [Abstract Factory Design Pattern in Java (DigitalOcean)](https://www.digitalocean.com/community/tutorials/abstract-factory-design-pattern-in-java)
188186
* [Abstract Factory(Refactoring Guru)](https://refactoring.guru/design-patterns/abstract-factory)
189187

190-
## Benefits and Trade-offs of Abstract Factory Pattern
191-
192-
Benefits:
193-
194-
* Flexibility: Easily switch between product families without code modifications.
188+
## Vor- und Nachteile
195189

196-
* Decoupling: Client code only interacts with abstract interfaces, promoting portability and maintainability.
190+
Vorteile:
197191

198-
* Reusability: Abstract factories and products facilitate component reuse across projects.
192+
* Flexibilität: Einfacher Wechsel zwischen Produktfamilien ohne Codeänderung.
199193

200-
* Maintainability: Changes to individual product families are localized, simplifying updates.
194+
* Entkopplung: Der Verwender sieht nur abstrakte Interfaces, wodurch sich Portabilität und Wartbarkeit verbessern.
201195

202-
Trade-offs:
196+
* Wiederverwendbarkeit: Objekte aus einer Abstract Factory können projektübergreifend eingesetzt werden.
203197

204-
* Complexity: Defining abstract interfaces and concrete factories adds initial overhead.
198+
* Wartbarkeit: Änderungen an einer einzelnen Produktfamilie sind nur lokal in deren Implementation nötig, was Updates erleichtert.
199+
*
200+
Nachteile:
205201

206-
* Indirectness: Client code interacts with products indirectly through factories, potentially reducing transparency.
202+
* Komplexität: Anfänglicher Zusatzaufwand für die Definition von Interfaces und konkreten Factories.
203+
*
204+
* Intransparenz: Die Transparenz könnte leiden, weil der Client-Code mit den Produkten nur indirekt über den Umweg der Factories interagiert.
207205

208-
## Real-World Applications of Abstract Factory Pattern in Java
206+
## Reale Anwendungen
209207

210-
* Java Swing's `LookAndFeel` classes for providing different look-and-feel options.
211-
* Various implementations in the Java Abstract Window Toolkit (AWT) for creating different GUI components.
208+
* Die `LookAndFeel` Klassen von Java Swing stellen mittels Abstract Factory verschiedene optische Darstellungen zur Verfügung.
209+
* Verschiedene Implementationen im Java Abstract Window Toolkit (AWT) zur Erzeugung diverser GUI-Komponenten.
212210
* [javax.xml.parsers.DocumentBuilderFactory](http://docs.oracle.com/javase/8/docs/api/javax/xml/parsers/DocumentBuilderFactory.html)
213211
* [javax.xml.transform.TransformerFactory](http://docs.oracle.com/javase/8/docs/api/javax/xml/transform/TransformerFactory.html#newInstance--)
214212
* [javax.xml.xpath.XPathFactory](http://docs.oracle.com/javase/8/docs/api/javax/xml/xpath/XPathFactory.html#newInstance--)
215213

216-
## Related Java Design Patterns
214+
## Verwandte Patterns
217215

218-
* [Factory Method](https://java-design-patterns.com/patterns/factory-method/): Abstract Factory uses Factory Methods to create products.
219-
* [Singleton](https://java-design-patterns.com/patterns/singleton/): Abstract Factory classes are often implemented as Singletons.
220-
* [Factory Kit](https://java-design-patterns.com/patterns/factory-kit/): Similar to Abstract Factory but focuses on configuring and managing a set of related objects in a flexible way.
216+
* [Factory-Methoden](https://java-design-patterns.com/patterns/factory-method/): Abstract Factory verwendet Factory-Methoden zur Erzeugung von Produkten.
217+
* [Singleton](https://java-design-patterns.com/patterns/singleton/): Abstract-Factory-Klassen sind häufig als Singletons implementiert.
218+
* [Factory Kit](https://java-design-patterns.com/patterns/factory-kit/): Ähnlich wie Abstract Factory, aber mit Schwerpunkt auf flexibler Konfiguration und Verwaltung verwandter Objekte .
221219

222-
## References and Credits
220+
## Quellen
223221

224222
* [Design Patterns: Elements of Reusable Object-Oriented Software](https://amzn.to/3w0pvKI)
225223
* [Design Patterns in Java](https://amzn.to/3Syw0vC)

0 commit comments

Comments
 (0)