Skip to content

Commit bdc33a5

Browse files
Doc
1 parent b6b6bf6 commit bdc33a5

2 files changed

Lines changed: 90 additions & 7 deletions

File tree

DEVELOPMENT.md

Lines changed: 66 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -74,3 +74,69 @@ It will:
7474
* bump version is source files automatically,
7575
* commit changes,
7676
* push release tag that will initiate [release workflow](.github/workflows/release-perform.yml).
77+
78+
# Coding Conventions
79+
80+
## File Naming
81+
82+
| Pattern | Purpose | Example |
83+
|---------|---------|--------|
84+
| `local_*.go` | Local instance-specific functionality | `local_instance.go`, `local_instance_manager.go` |
85+
| `*_manager.go` | Manager classes handling collections/operations | `package_manager.go`, `osgi_bundle_manager.go` |
86+
| `*_test.go` | Unit tests | `instance_test.go` |
87+
| `*_int_test.go` | Integration tests (require running AEM) | `osgi_int_test.go` |
88+
89+
## Architectural Patterns
90+
91+
### Manager Hierarchy
92+
93+
Three types of managers exist:
94+
95+
1. **AEM-level** - owned by `AEM` facade, operate globally (`VendorManager`, `ContentManager`)
96+
2. **Instance-level** - owned by `Instance`, operate via HTTP (`PackageManager`, `OSGiBundleManager`)
97+
3. **Sub-entity** - owned by facade types (`OSGi` owns `BundleManager`, `ConfigManager`, etc.)
98+
99+
### Entity + EntityState
100+
101+
Domain entities have paired `*State` structs for serialization:
102+
103+
```go
104+
type OSGiBundle struct { manager *OSGiBundleManager; symbolicName string }
105+
type OSGiBundleState struct { SymbolicName string `yaml:"symbolic_name"` }
106+
```
107+
108+
### WithChanged Pattern
109+
110+
Methods returning `(bool, error)` indicate if change was made (for idempotent operations):
111+
112+
```go
113+
func (b OSGiBundle) Start() error { ... } // Always attempts
114+
func (b OSGiBundle) StartWithChanged() (bool, error) // Returns false if already started
115+
```
116+
117+
### Facade Pattern
118+
119+
`OSGi`, `Sling`, `Repo`, `Auth` group related managers:
120+
121+
```go
122+
type OSGi struct {
123+
bundleManager *OSGiBundleManager
124+
componentManager *OSGiComponentManager
125+
configManager *OSGiConfigManager
126+
}
127+
```
128+
129+
## Utility Packages
130+
131+
Packages in `pkg/common/` use `*x` suffix for extended stdlib functionality:
132+
133+
`pathx`, `fmtx`, `httpx`, `stringsx`, `timex`, `osx`, `filex`, `cryptox`, `execx`, `tplx`, `netx`
134+
135+
## Sub-packages
136+
137+
`pkg/{domain}/` contains pure data types without AEM dependencies:
138+
139+
- `pkg/osgi/` - OSGi data structures
140+
- `pkg/instance/` - Instance constants and utilities
141+
- `pkg/content/` - Content manipulation
142+
- `pkg/keystore/` - Keystore types

README.md

Lines changed: 24 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,6 @@
11
![AEM Compose Logo](https://github.com/wttech/aemc-ansible/raw/main/docs/logo-with-text.png)
2-
3-
<a href="https://www.vml.com/expertise/enterprise-solutions" target="_blank">
4-
<picture>
5-
<source srcset="docs/vml-logo-white.svg" media="(prefers-color-scheme: dark)">
6-
<img src="docs/vml-logo-black.svg" alt="VML Logo" height="100">
7-
</picture>
8-
</a>
2+
&nbsp;&nbsp;&nbsp;&nbsp;
3+
<a href="https://www.vml.com/expertise/enterprise-solutions" target="_blank"><picture><source srcset="docs/vml-logo-white.svg" media="(prefers-color-scheme: dark)"><img src="docs/vml-logo-black.svg" alt="VML Logo" height="100"></picture></a>
94

105
[![GitHub All Releases](https://img.shields.io/github/downloads/wttech/aemc/total)](https://github.com/wttech/aemc/releases)
116
[![Last Release Version](https://img.shields.io/github/v/release/wttech/aemc?color=lightblue&label=Last%20Release)](https://github.com/wttech/aemc/releases)
@@ -62,6 +57,8 @@ Its seamless integration with Terraform, Pulumi, and Ansible enhances automation
6257
- [Increasing verbosity](#increasing-verbosity)
6358
- [Installing content packages](#installing-content-packages)
6459
- [Installing packages with troubleshooting](#installing-packages-with-troubleshooting)
60+
- [Concepts](#concepts)
61+
- [Local vs Remote Instances](#local-vs-remote-instances)
6562
- [Examples](#examples)
6663
- [Replication agents](#replication-agents)
6764
- [SSL by Default](#ssl-by-default)
@@ -655,6 +652,26 @@ This new feature offers two distinct modes for leveraging its benefits:
655652
AEM_INSTANCE_PACKAGE_INSTALL_HTML_ENABLED=true AEM_INSTANCE_PACKAGE_INSTALL_HTML_CONSOLE=true sh aemw package deploy --file my-package.zip
656653
```
657654

655+
# Concepts
656+
657+
## Local vs Remote Instances
658+
659+
AEMC distinguishes between **local** and **remote** AEM instances:
660+
661+
| Type | Description | Operations |
662+
|------|-------------|------------|
663+
| **Local** | Instances running on developer's machine, fully managed by AEMC | Create, Start, Stop, Delete, Backup, filesystem access, JVM options, run modes |
664+
| **Remote** | Any AEM instance accessible via HTTP (cloud, VMs, etc.) | HTTP-based operations only: packages, OSGi, repository, replication |
665+
666+
This distinction is reflected in the codebase and CLI:
667+
668+
- **`aem instance`** commands work with any instance (local or remote)
669+
- **`aem instance local`** commands are specific to locally managed instances
670+
671+
When configuring instances, AEMC automatically determines the type based on the `http_url`:
672+
- URLs with `localhost` or `127.0.0.1` → treated as **local**
673+
- Other URLs → treated as **remote**
674+
658675
# Examples
659676

660677
## Replication agents

0 commit comments

Comments
 (0)