wp-feature-notifications
wp-feature-notifications copied to clipboard
Plugin Architecture
To be able to break the project into simple tasks, it is useful to have an overview of how the different parts of the plugin will be organized. Here's my proposal:
-
User Interface: This is the graphical interface that our designers have been iterating upon. It can be broken down into three distinct parts:
- The Notification Hub will stick into WordPress administration toolbar. See #23
- The On-Page Notifications should replace the current admin notices at some point. See #26
- The Notifications Settings Page will be the place where to configure which and how notifications are sent. See #24
-
Business logic: This is the part that actually gives meaning to the project. It is broken down into three uneven sub-parts:
- The Service(s) understands the Notifications, Recipients and Senders abstractions, and calls to the correct delivery methods to serve the notifications.
- The Data Models are definitions of the Notifications, Recipients and Senders data that will flow through the plugin. It doesn't contain any logic in itself.
- The Settings are a way to configure if and how the Service(s) will deliver the notifications to their recipients.
-
Persistence Layer: Stores and retrieve the data to be used. Persistence is an abstraction that will allow to configure connection with:
- WordPress' Database Abstraction. Storing the notification in the website main database will be the default behavior.
- External storage mechanisms at websites developers discretion, through WP Notify's Persistence API (V2). This feature will be implemented in a later stage, but justifies that we add our own persistence abstraction layer right from the beginning.
-
Boundaries: These abstractions will help ensuring an easier compatibility with WordPress and third-party plugins.
- WP Abstractions will be simple wrappers around WordPress Core features. This will allow us to locate our compatibility with different WordPress versions in common places. These should be the only parts to be modified when integrating WP Notify into WordPress Core.
- Plugin API (Object Oriented): This will let third-party plugins register their notification with access to the full features that WP Notify offers in a comprehensible API.
- Plugin API (Procedural): Built atop the Object Oriented API, this will let less OOP experienced developers register their notifications in a simple way.
@raaaahman What is your tool for the diagramm?
@szepeviktor Draw.io (Also exists as desktop app)
The png above actually includes diagram data as XML, so you can download and edit it with this app.