Skip to content

App: Document static classes and common patterns in services - #1663

Merged
crazyserver merged 2 commits into
moodle:mainfrom
dpalou:MOBILE-4575
Jul 29, 2026
Merged

App: Document static classes and common patterns in services#1663
crazyserver merged 2 commits into
moodle:mainfrom
dpalou:MOBILE-4575

Conversation

@dpalou

@dpalou dpalou commented Jul 29, 2026

Copy link
Copy Markdown
Contributor

No description provided.

Copilot AI review requested due to automatic review settings July 29, 2026 10:58
@dpalou
dpalou requested a review from a team as a code owner July 29, 2026 10:58
@netlify

netlify Bot commented Jul 29, 2026

Copy link
Copy Markdown

Deploy Preview for moodledevdocs ready!

Built without sensitive environment variables

Name Link
🔨 Latest commit 7c899cd
🔍 Latest deploy log https://app.netlify.com/projects/moodledevdocs/deploys/6a69de593bb0230007bc28f1
😎 Deploy Preview https://deploy-preview-1663--moodledevdocs.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.
🤖 Make changes Run an agent on this branch

To edit notification comments on pull requests, go to your Netlify project configuration.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR updates the Moodle App development guide to better document the purpose of core/static classes and to describe common, recommended service structuring patterns (layering, WS access separation, and consistent *WSService method signatures).

Changes:

  • Clarifies core/singletons and adds a new core/static section describing intended usage of static utility classes.
  • Updates the “Singletons” section to focus on “Service Singletons”.
  • Adds a new “Services” section describing common layering patterns and a recommended WS service signature convention.
Comments suppressed due to low confidence (2)

general/app/development/development-guide.md:349

  • This section removes the definition of "Pure Singletons" but still references them ("In contrast with pure singletons"), which makes the documentation internally inconsistent. Reword to avoid referencing a term that is no longer defined, and fix singular/plural for "Service Singleton(s)".
The application relies heavily on the [Singleton design pattern](https://en.wikipedia.org/wiki/Singleton_pattern). Right now the app only uses the singleton pattern for Angular Services, what we call "Service Singleton".

### Service Singletons {/* #service-singletons */}

Service singletons are instances resolved from the [root application injector](https://angular.io/guide/hierarchical-dependency-injection). In contrast with pure singletons, these are defined as Angular services. In particular, these should be [singleton services](https://angular.io/guide/singleton-services).

general/app/development/development-guide.md:413

  • Grammar: "generated in offline in the app" reads incorrectly; it should be "generated offline in the app".
- An optional sync service to handle sending data generated in offline in the app back to the server (for example, `MyFeatureSyncService`).

Comment thread general/app/development/development-guide.md Outdated
@crazyserver
crazyserver added this pull request to the merge queue Jul 29, 2026
Merged via the queue into moodle:main with commit 9033871 Jul 29, 2026
5 of 6 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants