Apple WebObjects 5 Bedienungsanleitung Seite 38

  • Herunterladen
  • Zu meinen Handbüchern hinzufügen
  • Drucken
  • Seite
    / 108
  • Inhaltsverzeichnis
  • LESEZEICHEN
  • Bewertet. / 5. Basierend auf Kundenbewertungen
Seitenansicht 37
38 A Programmer’s View of WebObjects
Apple Computer, Inc. January 2002
CHAPTER 4
HTML-Based Applications
These advantages are discussed in more detail in the sections that follow.
Separating Presentation Code from Event-Handling
Logic
In WebObjects, a Web page is represented by a component, an object that has both
content and behavior. A component can also represent a portion of a page but
usually represents an entire page, so the word page is used interchangeably with the
word component.
Components consist of
a template in HTML code that specifies how the component looks. This file
can be edited by any HTML editor or text editor.
event-handling logic that specifies how the component acts. You specify this
with a standard Java source file.
bindings that associate the component’s layout specification (HTML code)
with its event-handling methods. These bindings are stored in a text file.
Separating the presentation code, event-handling logic, and bindings makes it
much easier to maintain a Web application. A graphic artist can modify the
presentation code, thus modifying the appearance of the page, without breaking its
event-handling logic. A programmer can completely rewrite the event-handling
logic without accidentally changing the page’s layout.
You do not need to edit all three files separately. WebObjects Builder, a graphical
component editing tool provided with WebObjects Development, edits the
template, bindings, and event-handling code files simultaneously, relieving you of
having to manually synchronize them. WebObjects Builder is described in more
detail in “WebObjects Builder” (page 46).
Figure 4-1 (page 39) shows the three files in an example component.
Seitenansicht 37
1 2 ... 33 34 35 36 37 38 39 40 41 42 43 ... 107 108

Kommentare zu diesen Handbüchern

Keine Kommentare