-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdocs.html
More file actions
548 lines (490 loc) · 22.9 KB
/
Copy pathdocs.html
File metadata and controls
548 lines (490 loc) · 22.9 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Documentation - Draagon MetaObjects: AI-Optimized Enterprise Platform</title>
<meta name="description" content="Complete documentation for the AI-optimized enterprise development platform. Get started with metadata-driven development for AI applications.">
<meta name="keywords" content="AI development documentation, enterprise AI platform, metadata-driven AI, AI consistency platform, enterprise development guide, AI-optimized architecture">
<meta name="author" content="Doug Mealing LLC">
<!-- Canonical URL -->
<link rel="canonical" href="https://draagon.github.io/docs.html">
<!-- Favicon -->
<link rel="icon" type="image/jpeg" href="images/logo_head.jpg">
<link rel="apple-touch-icon" href="images/logo_head.jpg">
<!-- Google Analytics -->
<script async src="https://www.googletagmanager.com/gtag/js?id=GA_MEASUREMENT_ID"></script>
<script>
window.dataLayer = window.dataLayer || [];
function gtag(){dataLayer.push(arguments);}
gtag('js', new Date());
gtag('config', 'GA_MEASUREMENT_ID');
</script>
<!-- Fonts -->
<link href="https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800&display=swap" rel="stylesheet">
<!-- Styles -->
<link rel="stylesheet" href="styles.css">
<!-- Syntax Highlighting -->
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/highlight.js/11.9.0/styles/atom-one-dark.min.css">
<script src="https://cdnjs.cloudflare.com/ajax/libs/highlight.js/11.9.0/highlight.min.js"></script>
</head>
<body>
<!-- Navigation -->
<nav>
<div class="nav-container">
<a href="index.html" class="logo">
<img src="images/logo_head.jpg" alt="Draagon Logo" />
Draagon MetaObjects
</a>
<ul class="nav-links">
<li><a href="index.html">Home</a></li>
<li><a href="features.html">Features</a></li>
<li><a href="enterprise.html">Enterprise</a></li>
<li><a href="support.html">Support</a></li>
<li><a href="docs.html">Documentation</a></li>
<li><a href="blog.html">Blog</a></li>
<li><a href="community.html">Community</a></li>
<li><a href="https://github.com/Draagon/draagon-metaobjects" target="_blank">GitHub</a></li>
</ul>
</div>
</nav>
<!-- Page Header -->
<div class="page-container">
<div class="page-header">
<h1>Documentation</h1>
<p>Everything you need to get started with MetaObjects and build metadata-driven applications</p>
</div>
<!-- Quick Start Guide -->
<section class="section">
<div class="section-header">
<h2>Quick Start Guide</h2>
<p>Get up and running with MetaObjects in minutes</p>
</div>
<div class="content-grid" style="grid-template-columns: 1fr;">
<div class="content-card">
<h3>Step 1: Add Dependency</h3>
<p>Add the MetaObjects dependency to your Maven project:</p>
<div class="code-block" style="margin-top: 1rem;">
<pre><code class="language-xml"><dependency>
<groupId>com.draagon.metaobjects</groupId>
<artifactId>metaobjects-core</artifactId>
<version>5.1.0</version>
</dependency></code></pre>
</div>
</div>
<div class="content-card">
<h3>Step 2: Define Metadata</h3>
<p>Create a <code>metadata/model.json</code> file with your object definitions:</p>
<div class="code-block" style="margin-top: 1rem;">
<pre><code class="language-json">{
"metadata": {
"package": "com.example",
"children": [
{
"object": {
"name": "User",
"type": "pojo",
"children": [
{"field": {"name": "id", "type": "long"}},
{"field": {"name": "email", "type": "string"}},
{"field": {"name": "name", "type": "string"}}
]
}
}
]
}
}</code></pre>
</div>
</div>
<div class="content-card">
<h3>Step 3: Configure Maven Plugin</h3>
<p>Add the MetaObjects Maven plugin to generate code during build:</p>
<div class="code-block" style="margin-top: 1rem;">
<pre><code class="language-xml"><plugin>
<groupId>com.draagon.metaobjects</groupId>
<artifactId>metaobjects-maven-plugin</artifactId>
<version>5.1.0</version>
<configuration>
<generators>
<generator>
<className>com.draagon.meta.generator.JavaInterfaceGenerator</className>
</generator>
</generators>
</configuration>
</plugin></code></pre>
</div>
</div>
<div class="content-card">
<h3>Step 4: Generate Code</h3>
<p>Run the Maven plugin to generate your code:</p>
<div class="code-block" style="margin-top: 1rem;">
<pre><code class="language-bash">mvn metaobjects:generate</code></pre>
</div>
</div>
<div class="content-card">
<h3>Step 5: Use Generated Code</h3>
<p>Import and use the generated classes in your application:</p>
<div class="code-block" style="margin-top: 1rem;">
<pre><code class="language-java">// Load metadata with proper configuration
FileMetaDataLoader loader = new FileMetaDataLoader(
new FileLoaderOptions()
.addParser("*.json", JsonMetaDataParser.class)
.addSources(new LocalFileMetaDataSources(
Arrays.asList(
"com/draagon/meta/loader/xml/metaobjects.types.json",
"metadata/users/user.metadata.json"
)
)),
"user-example"
).init();
MetaObject userMeta = loader.getMetaObject("User");
// Create instance
Object user = userMeta.newInstance();
userMeta.setFieldValue(user, "email", "user@example.com");
userMeta.setFieldValue(user, "name", "John Doe");
// Validate
ValidationResult result = userMeta.performValidation(user);
if (result.isValid()) {
System.out.println("User is valid!");
}</code></pre>
</div>
</div>
</div>
</section>
<!-- System Requirements -->
<section class="section" style="background: var(--light-gray); margin: 4rem -2rem; padding: 4rem 2rem;">
<div class="section-header">
<h2>System Requirements</h2>
<p>Technical specifications for MetaObjects</p>
</div>
<div class="content-grid">
<div class="content-card">
<h3>Runtime Requirements</h3>
<ul>
<li>Java 21 or higher</li>
<li>512MB RAM minimum</li>
<li>100MB disk space</li>
<li>Any JDBC-compatible database (optional)</li>
</ul>
</div>
<div class="content-card">
<h3>Build Requirements</h3>
<ul>
<li>Maven 3.6 or higher</li>
<li>Java Development Kit (JDK) 21+</li>
<li>Git for version control</li>
<li>IDE support (IntelliJ, Eclipse, VS Code)</li>
</ul>
</div>
<div class="content-card">
<h3>Supported Languages</h3>
<ul>
<li>Java (Full support)</li>
<li>TypeScript (Full support)</li>
<li>C# (Generation support)</li>
<li>Python (Generation support)</li>
<li>JavaScript (Generation support)</li>
</ul>
</div>
<div class="content-card">
<h3>Supported Databases</h3>
<ul>
<li>PostgreSQL</li>
<li>MySQL / MariaDB</li>
<li>Oracle Database</li>
<li>Microsoft SQL Server</li>
<li>H2 Database</li>
<li>Any JDBC-compatible database</li>
</ul>
</div>
</div>
</section>
<!-- Architecture Overview -->
<section class="section">
<div class="section-header">
<h2>Architecture Overview</h2>
<p>Understanding the core components of MetaObjects</p>
</div>
<div class="content-grid">
<div class="content-card">
<h3>Metadata Module</h3>
<p>Core metadata models and types that define the foundation of the system.</p>
<ul>
<li>Core metadata models and types</li>
<li>Base interfaces and abstractions</li>
<li>Exception hierarchy</li>
<li>Data type system</li>
</ul>
</div>
<div class="content-card">
<h3>Maven Plugin Module</h3>
<p>Build-time integration that generates code during your Maven build process.</p>
<ul>
<li>Build-time code generation</li>
<li>Maven lifecycle integration</li>
<li>Generator framework</li>
<li>Configuration management</li>
</ul>
</div>
<div class="content-card">
<h3>Core Module</h3>
<p>Runtime components that power the metadata-driven behavior in your applications.</p>
<ul>
<li>MetaObject implementations</li>
<li>Loader framework</li>
<li>Serialization system</li>
<li>Validation framework</li>
</ul>
</div>
<div class="content-card">
<h3>Object Manager Module</h3>
<p>High-level abstraction layer for data persistence and querying.</p>
<ul>
<li>Persistence abstraction</li>
<li>Query framework</li>
<li>Expression system</li>
<li>Manager integration</li>
</ul>
</div>
</div>
</section>
<!-- API Reference -->
<section class="section" style="background: var(--light-gray); margin: 4rem -2rem; padding: 4rem 2rem;">
<div class="section-header">
<h2>Core API Reference</h2>
<p>Key interfaces and classes you'll work with</p>
</div>
<div class="content-grid">
<div class="content-card">
<h3>MetaObject Interface</h3>
<p>The core interface for working with metadata-driven objects.</p>
<ul>
<li><code>newInstance()</code> - Create new objects</li>
<li><code>getFieldValue()</code> - Get field values</li>
<li><code>setFieldValue()</code> - Set field values</li>
<li><code>performValidation()</code> - Validate objects</li>
<li><code>getMetaFields()</code> - Get field metadata</li>
</ul>
</div>
<div class="content-card">
<h3>MetaDataLoader</h3>
<p>Loads metadata definitions from various sources.</p>
<ul>
<li>Load from JSON/XML files</li>
<li>Runtime metadata updates</li>
<li>Multiple source support</li>
<li>Classpath and file system loading</li>
</ul>
</div>
<div class="content-card">
<h3>Validation Framework</h3>
<p>Comprehensive validation system for data integrity.</p>
<ul>
<li>Field-level validators</li>
<li>Object-level validators</li>
<li>Custom validation rules</li>
<li>Validation chains</li>
</ul>
</div>
<div class="content-card">
<h3>Generator Framework</h3>
<p>Extensible code generation system.</p>
<ul>
<li>Pluggable generators</li>
<li>Custom templates</li>
<li>Multiple output formats</li>
<li>Build integration</li>
</ul>
</div>
</div>
</section>
<!-- Best Practices -->
<section class="section">
<div class="section-header">
<h2>Best Practices</h2>
<p>Proven patterns for successful MetaObjects implementations</p>
</div>
<div class="content-grid">
<div class="content-card">
<h3>Metadata Organization</h3>
<ul>
<li>One package per domain</li>
<li>Logical grouping of objects</li>
<li>Clear naming conventions</li>
<li>Version control metadata</li>
</ul>
</div>
<div class="content-card">
<h3>Development Workflow</h3>
<ul>
<li>Define metadata first</li>
<li>Generate code during build</li>
<li>Validate at runtime</li>
<li>Test with metadata</li>
</ul>
</div>
<div class="content-card">
<h3>Production Deployment</h3>
<ul>
<li>Pre-load metadata at startup</li>
<li>Monitor metadata changes</li>
<li>Use overlay system for environments</li>
<li>Enable caching for performance</li>
</ul>
</div>
<div class="content-card">
<h3>Performance Optimization</h3>
<ul>
<li>Cache metadata definitions</li>
<li>Use lazy loading for large datasets</li>
<li>Optimize serialization settings</li>
<li>Monitor memory usage</li>
</ul>
</div>
</div>
</section>
<!-- Common Use Cases -->
<section class="section" style="background: var(--light-gray); margin: 4rem -2rem; padding: 4rem 2rem;">
<div class="section-header">
<h2>Common Use Cases</h2>
<p>How to apply MetaObjects in different scenarios</p>
</div>
<div class="content-grid">
<div class="content-card">
<h3>REST API Development</h3>
<p>Generate consistent DTOs and validation across services. Perfect for microservices architectures where multiple services need to share data models.</p>
<div class="code-block" style="margin-top: 1rem;">
<pre><code class="language-java">@RestController
public class UserController {
@PostMapping("/users")
public ResponseEntity<User> createUser(@Valid @RequestBody User user) {
// Validation handled automatically by metadata
return ResponseEntity.ok(userService.save(user));
}
}</code></pre>
</div>
</div>
<div class="content-card">
<h3>Database Entities</h3>
<p>Generate JPA entities with proper annotations directly from your metadata definitions.</p>
<div class="code-block" style="margin-top: 1rem;">
<pre><code class="language-java">@Entity
@Table(name = "users")
public class User {
@Id
@GeneratedValue(strategy = GenerationType.IDENTITY)
private Long id;
@Column(nullable = false)
private String email;
// Generated getters and setters
}</code></pre>
</div>
</div>
<div class="content-card">
<h3>Frontend Models</h3>
<p>Generate TypeScript interfaces and validators for your frontend applications.</p>
<div class="code-block" style="margin-top: 1rem;">
<pre><code class="language-typescript">// Auto-generated TypeScript interface
export interface User {
id: number;
email: string;
name: string;
}
// Auto-generated validation
export const validateUser = (user: User): ValidationResult => {
// Consistent validation rules from metadata
};</code></pre>
</div>
</div>
<div class="content-card">
<h3>Service Integration</h3>
<p>Ensure consistent data models between services and external systems.</p>
<div class="code-block" style="margin-top: 1rem;">
<pre><code class="language-java">// Service A
UserDTO user = metaObjectService.convert(userEntity, UserDTO.class);
// Service B - automatically compatible
UserResponse response = externalService.createUser(user);
// Same metadata ensures compatibility</code></pre>
</div>
</div>
</div>
</section>
<!-- Migration Guide -->
<section class="section">
<div class="section-header">
<h2>Migration Path</h2>
<p>How to adopt MetaObjects in existing projects</p>
</div>
<div class="content-grid">
<div class="content-card">
<h3>From Traditional Development</h3>
<p>Gradual adoption strategy for existing codebases:</p>
<ol style="margin-left: 1.5rem; color: var(--gray);">
<li>Define existing models as metadata</li>
<li>Generate interfaces alongside existing code</li>
<li>Gradually adopt runtime features</li>
<li>Full metadata-driven architecture</li>
</ol>
</div>
<div class="content-card">
<h3>From Other Frameworks</h3>
<p>Integration strategies for popular frameworks:</p>
<ul>
<li>Import existing schemas (JPA, JSON Schema)</li>
<li>Map to MetaObjects format</li>
<li>Generate compatibility layers</li>
<li>Incremental migration</li>
</ul>
</div>
</div>
</section>
<!-- External Resources -->
<section class="section" style="background: var(--light-gray); margin: 4rem -2rem; padding: 4rem 2rem;">
<div class="section-header">
<h2>External Resources</h2>
<p>Additional documentation and examples</p>
</div>
<div class="content-grid">
<div class="content-card">
<h3>📖 GitHub Repository</h3>
<p>Complete source code, examples, and issue tracking</p>
<a href="https://github.com/Draagon/draagon-metaobjects" target="_blank" class="btn btn-primary" style="margin-top: 1rem;">View on GitHub</a>
</div>
<div class="content-card">
<h3>📝 API Documentation</h3>
<p>Comprehensive JavaDoc documentation for all classes and interfaces</p>
<a href="https://github.com/Draagon/draagon-metaobjects/tree/main/docs" target="_blank" class="btn btn-primary" style="margin-top: 1rem;">Browse API Docs</a>
</div>
<div class="content-card">
<h3>💡 Examples Repository</h3>
<p>Sample projects demonstrating various MetaObjects patterns</p>
<a href="https://github.com/Draagon/draagon-metaobjects/tree/main/examples" target="_blank" class="btn btn-primary" style="margin-top: 1rem;">View Examples</a>
</div>
<div class="content-card">
<h3>🗣️ Community Support</h3>
<p>Get help from the community and contribute to the project</p>
<a href="community.html" class="btn btn-primary" style="margin-top: 1rem;">Join Community</a>
</div>
</div>
</section>
</div>
<!-- Footer -->
<footer>
<div class="footer-content">
<div class="footer-links">
<a href="https://github.com/Draagon/draagon-metaobjects" target="_blank">GitHub</a>
<a href="https://github.com/Draagon/draagon-metaobjects/blob/main/README.md" target="_blank">Documentation</a>
<a href="https://github.com/Draagon/draagon-metaobjects/blob/main/LICENSE" target="_blank">Apache 2.0 License</a>
<a href="https://github.com/Draagon/draagon-metaobjects/discussions" target="_blank">Community</a>
</div>
<p>© 2024 Doug Mealing LLC. All rights reserved.</p>
</div>
</footer>
<script>
// Initialize syntax highlighting
hljs.highlightAll();
</script>
<!-- Scripts -->
<script src="script.js"></script>
</body>
</html>