How se38/geojson works
Main Components
a. ABAP Source Code Repository:
• The "src" directory holds all the ABAP classes (e.g., zcl_geojson, zcl_geojson_leafletjs, zcl_geojson_point, etc.), interfaces (zif_geojson_feature.intf), and demo reports (zgeojson_demo, zgeojson_demo_layer).
• This repository is managed through abapGit, as indicated by the “.abapgit.xml” file.
b. External Dependencies:
• A dependency on the external [JSON Document Class] is explicitly required (version 2.33 or later). This component is critical because it handles JSON generation and manipulations.
c. Frontend/Display Integration:
• Although the project runs on the ABAP platform, its README highlights integration with LeafletJS for rendering the GeoJSON data. This establishes a frontend component that consumes the JSON output from the ABAP backend.
d. Data/Configuration:
• GeoJSON data examples like files ending in “.geojson” (e.g., the file in the "src" folder) are provided and possibly act as sample data or templates for generating ABAP-driven GeoJSON outputs.
Relationships and Interactions
• The core ABAP classes (zcl_geojson and its supporting ones) are responsible for generating and managing GeoJSON feature collections.
• The JSON Document Class acts as the utility/helper to format and output JSON data accurately.
• There is a clear interaction point between the output JSON (from the ABAP backend) and the LeafletJS frontend that consumes and displays the data.
Architectural Patterns & Principles
• Modularization of functionality: Each GeoJSON type (point, polygon, linestring) is handled by its own ABAP class, following a clean separation of concerns.
• Interface usage: zif_geojson_feature.intf is used to define a contract for GeoJSON features, which aids in ensuring extensibility and abstraction.
• Demonstration (or sample application) pattern: The existence of demo reports shows how the library can be integrated into practical applications.
• Integration: The coupling with LeafletJS indicates a layered architecture where the backend (ABAP) constructs the data and a separate client-side technology (LeafletJS) handles the presentation.