Raible's Wiki

Raible Designs
Wiki Home
News
Recent Changes

AppFuse

Homepage
  - Korean
  - Chinese
  - Italian
  - Japanese

QuickStart Guide
  - Chinese
  - French
  - German
  - Italian
  - Korean
  - Portuguese
  - Spanish
  - Japanese

User Guide
  - Korean
  - Chinese

Tutorials
  - Chinese
  - German
  - Italian
  - Korean
  - Portuguese
  - Spanish

FAQ
  - Korean

Latest Downloads

Other Applications

Struts Resume
Security Example
Struts Menu

Set your name in
UserPreferences


Referenced by
Articles_de
CreateActions_de
CreateDAO_de




JSPWiki v2.2.33

[RSS]


Hide Menu

CreateManager_de


Difference between version 17 and version 10:

At line 6 changed 1 line.
Dieses Tutorial erklärt, wie mann eine Business Facade Klaasse (Und den dazugehörigen JUnit Test) erzeugt, um mit der DAO Schicht zu kommunizieren, die wir in [Teil I|CreateDAO_de] erzeugt haben.
Dieses Tutorial erklärt, wie mann eine Business Facade Klasse (Und den dazugehörigen JUnit Test) erzeugt, um mit der DAO Schicht zu kommunizieren, die wir in [Teil I|CreateDAO_de] erzeugt haben.
At line 74 changed 1 line.
// set expected behavior on dao
// set expected behavior on dao
//Das erwartete Verhalten fuer die DAO definieren
At line 85 added 1 line.
//Das erwartete Verhalten fuer die DAO definieren
At line 97 added 1 line.
//Benoetigte Felder stetzen
At line 102 added 1 line.
//Das erwartete Verhalten fuer die DAO definieren
At line 109 added 1 line.
//Erwartungen zurücksetzen
At line 117 added 1 line.
//Erwartungen zurücksetzen
At line 120 added 1 line.
//Entfernen
At line 129 added 2 lines.
At line 128 changed 1 line.
This class won't compile at this point because we have not created our PersonManager interface.
Zur Zeit wird diese Klasse noch nicht kompilieren, weil wir das Interface PersonManager noch nicht erzeugt haben.
At line 130 changed 1 line.
;:%%(color: blue)''I think it's funny how I've followed so many patterns to allow __extendibility__ in AppFuse. In reality, on most projects I've been on - I learn so much in a year that I don't want to extend the architecture - I want to rewrite it. Hopefully by keeping AppFuse up to date with my perceived best practices, this won't happen as much. Each year will just be an upgrade to the latest AppFuse, rather than a re-write. ;-)''
;:%%(color: blue)''Ich glaube, dass es sehr witzig ist, wie ich verschiedene Patterns angewendet habe, um __Erweiterbarkeit__ in AppFuse zu ermöglichen. In Wirklichkeit habe ich in den meisten meiner Projekte so viel in einem Jahr gelernt, dass ich die Architektur nicht erweitern will, ich will sie umschreiben. Ich hoffe dass das nicht zu oft passieren wird, indem ich AppFuse mit den meiner Meinung nach besten Lösungen auf dem neuesten Stand halte. Jedes Jahr wird es nur ein Upgrade für AppFuse geben, anstatt Appfuse umzuschreiben. ;-)''
At line 134 changed 1 line.
First off, create a PersonManager.java interface in the src/service/**/service directory and specify the basic CRUD methods for any implementation classes. ''I've eliminated the JavaDocs in the class below for display purposes.'' The ''setPersonDao()'' method is not used in most cases - its just exists so the PersonManagerTest can set the DAO on the interface.
Zu aller erst erzeugt man ein Interface mit dem Namen PersonManager.java im Verzeichnis src/service/**/service und definiert die grundlegenden CRUD Methoden für alle implementierenden Klassen. ''Ich habe die JavaDocs in den Klassen entfernt, um die Darstellung zu verbessern.'' Die ''setPersonDao()'' Methode wird in den meisten Fällen nicht genutzt. - Sie existiert nur, damit der PersonManagerTest die DAO über das Interface setzen kann..
At line 136 changed 1 line.
;:%%(color: blue)''As usual, I usually duplicate (open → save as) an existing file (i.e. UserManager.java).''%%
;:%%(color: blue)''Wie üblich, dupliziere (open → save as) ich eine bereits existierende Datei (z.B. UserManager.java).''%%
At line 153 changed 1 line.
Now let's create a PersonManagerImpl class that implements the methods in PersonManager. To do this, create a new class in src/service/**/service/impl and name it PersonManagerImpl.java. It should extend BaseManager and implement PersonManager.
Jetzt erzeugt wir eine PersonManagerImpl Klasse, die die Methoden des PersonManager Interfaces implementiert. Um dies zu tun, erzeugt man eine neue Klasse im Verzeichnis src/service/**/service/impl und nennt diese PersonManagerImpl.java. Diese sollte von der Klasse BaseManager abgeleitet sein und das Interface PersonManager implementieren.
At line 184 changed 1 line.
One thing to note is the {{setPersonDao()}} method. This is used by Spring to bind the PersonDao to this Manager. This is configured in the applicationContext-service.xml file. We'll get to configuring that in Step 3[3]. You should be able to compile everything now using "ant compile-service".
Eine Sache, auf die hingewiesen werden muss, ist die {{setPersonDao()}} Methode. Diese Methode wird von Spring genutzt, um die PersonDao an diesen Manager zu binden. Dies wird in der Datei applicationContext-service.xml konfiguriert. Zu diesem Punkt werden wir in Schritt 3[3] kommen. Jetzt sollte es möglich sein, alles mit der Hilfe von "ant compile-service" zu kompilieren.
At line 186 changed 1 line.
Now you need to edit Spring's config file for our services layer so it will know about this new Manager.
Jetzt muss man die Konfigurationsdatei von Spring editieren, damit unsere Service Schicht diesen neuen Manager kennt.
At line 190 changed 1 line.
To notify Spring of this our PersonManager interface and its implementation, open the src/service/**/service/applicationContext-service.xml file. In here, you should see a commented out definition for the "personManager" bean. Uncomment this, or add the following to the bottom of this file.
Um unser PersonManager Interface und die dazugehörige Implementierung in Spring bekanntzumachen, öffnet man die Datei src/service/**/service/applicationContext-service.xml. In dieser Datei kann man eine auskommentierte Definition für die "personManager" Bean finden. Man entfernt diesen Kommentar, oder fügt folgende Zeilen am Ende der Datei ein.
At line 201 changed 1 line.
The "parent" attribute refers to a bean definition for a [TransactionProxyFactoryBean|http://www.springframework.org/docs/api/org/springframework/transaction/interceptor/TransactionProxyFactoryBean.html] that has all the basic transaction attributes set.
Das "parent" Attribut bezieht sich auf eine Beandefinition für eine [TransactionProxyFactoryBean|http://www.springframework.org/docs/api/org/springframework/transaction/interceptor/TransactionProxyFactoryBean.html] , die alle grundlegenden Transaktionsattribute bereits gesetzt hat.
At line 206 changed 1 line.
Save all your edited files and try running __ant test-service -Dtestcase=PersonManager__.
Jetzt speichert man alle Tests und versucht, __ant test-service -Dtestcase=PersonManager__ auszuführen.
At line 214 changed 1 line.
The files that were modified and added to this point are [available for download|https://appfuse.dev.java.net/files/documents/1397/7484/appfuse-tutorial-managers-1.6.zip].
Die Dateien, die bis zu diesem Punkt geändert oder erstellt wurden, sind [zum Download verfügbar|https://appfuse.dev.java.net/files/documents/1397/7484/appfuse-tutorial-managers-1.6.zip].
At line 216 changed 1 line.
''Next Up:'' __Part III:__ [Creating Actions and JSPs|CreateActions] - A HowTo for creating Actions and JSPs in the AppFuse architecture.
''Next Up:'' __Teil III:__ [Actions und JSPs erstellen|CreateActions_de] - Eine Anleitung zur Erstellung von Actions und JSPs in der Architektur von AppFuse.

Back to CreateManager_de, or to the Page History.