Autor |
Beitrag |
Marco D.
Beiträge: 2750
Windows Vista
Delphi 7, Delphi 2005 PE, PHP 4 + 5 (Notepad++), Java (Eclipse), XML, XML Schema, ABAP, ABAP OO
|
Verfasst: Do 10.05.07 22:14
Ich habe eine Klasse Eventlog. Dann noch weitere Klassen wie z.B. UserManager oder PageManager. Ich füge einen neuen Eintrag im Eventlog mit:
C#-Quelltext 1: 2:
| $eventlog = new Eventlog(); $eventlog->Add(...); |
hinzu.
Was ist nun günstiger:
- diese Methode in der index.php aufzurufen,
- oder diese Methode in den anderen Klasse z.B. im UserManager aufzurufen?
Mein Gefühl sagt mir: letzteres!
_________________ Pascal keeps your hand tied. C gives you enough rope to hang yourself. C++ gives you enough rope to shoot yourself in the foot
|
|
Marco D.
Beiträge: 2750
Windows Vista
Delphi 7, Delphi 2005 PE, PHP 4 + 5 (Notepad++), Java (Eclipse), XML, XML Schema, ABAP, ABAP OO
|
Verfasst: Sa 12.05.07 21:48
Also der Vorteil, wenn man den Eventlogger innerhalb der anderen Klassen benutzt, wäre, dass man die Dateien, die aufgerufen werden (z.B. index.php) nicht mit diesem Zeug 'belastet' werden.
Was meinen die anderen?
Gibt es allgemein gesehen irgendwo einen Artikel oder dergleichen, wie man eine Webseite objektorientiert in PHP programmiert? Am meisten interessiert mich, wie Profis die Klassen einteilen.
_________________ Pascal keeps your hand tied. C gives you enough rope to hang yourself. C++ gives you enough rope to shoot yourself in the foot
|
|
Marco D.
Beiträge: 2750
Windows Vista
Delphi 7, Delphi 2005 PE, PHP 4 + 5 (Notepad++), Java (Eclipse), XML, XML Schema, ABAP, ABAP OO
|
Verfasst: Mo 14.05.07 09:08
Ist mein Anliegen etwa zu speziell
_________________ Pascal keeps your hand tied. C gives you enough rope to hang yourself. C++ gives you enough rope to shoot yourself in the foot
|
|
freak4fun
Beiträge: 604
Erhaltene Danke: 4
Win 7 Pro
VS 2013 Express, Delphi, C#, PHP, Java
|
Verfasst: Mo 14.05.07 09:40
Ja, in die Funktionen der Klassen selbst, weil du da die benötigten Daten immer hast. Außerdem ist dann der Inhalt vom Design weiterhin getrennt. Denn wenn du die Log-Funktionen in die Seite einbaust hast du auch mehr aufwand. Außerdem müsstest du mehr schreiben, da die Klassenfunktionen ja öfter aufgerufen werden.
Also ab damit in die Funktionen ...
MfG
fR34k
_________________ "Ich werde auf GAR KEINEN Fall…!" - "Keks?" - "Okay, ich tu's."
i++; // zaehler i um 1 erhoehen
|
|
Marco D.
Beiträge: 2750
Windows Vista
Delphi 7, Delphi 2005 PE, PHP 4 + 5 (Notepad++), Java (Eclipse), XML, XML Schema, ABAP, ABAP OO
|
Verfasst: Mo 14.05.07 09:49
Okay das ist klar. Danke.
_________________ Pascal keeps your hand tied. C gives you enough rope to hang yourself. C++ gives you enough rope to shoot yourself in the foot
|
|
|