Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Introduction draft #147

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion spec/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,7 @@
</execution>
</executions>
<configuration>
<sourceDocumentName>01-config-spec.adoc</sourceDocumentName>
<sourceDocumentName>config-spec.adoc</sourceDocumentName>
<sourceHighlighter>coderay</sourceHighlighter>
<attributes>
<revnumber>${project.version}</revnumber>
Expand Down
54 changes: 54 additions & 0 deletions spec/src/main/asciidoc/01-introduction.adoc
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
== Introduction

=== Scope

Jakarta Config ("Specification") is a Java API for working with configurations. It supports externalized configuration allowing applications to use different configurations for different environments (dev, test, prod), and allows reading data from different layered configuration sources such as property files, environment variables, etc.
Copy link
Contributor

Choose a reason for hiding this comment

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

I understand this is just a sketch. As it exists, it needs a lot of work. I will try to draft an introduction befitting a Jakarta EE specification. I will look at our discussion in #142 to proceed.


=== Goals
Copy link
Contributor

Choose a reason for hiding this comment

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

I suggest to put these in the readme instead of the spec doc as it is more suitable there.


- Specification must include a programmatic API allowing configuring and using configurations at runtime.
- Specification must include annotations based API allowing compile-time configuration.
- Specification must support converters and evaluate switching to Converters specification when it becomes available.
- Specification must support object-mapping. Solution must respect Java methods visibility principles.
- Specification must provide integration with CDI and optionally with dependency injection frameworks.
- Specification must distinguish empty strings and null values.
- Specification must support profiles such as dev, test and prod.
- Specification must support both mutable and immutable configuration sources.
Copy link
Contributor

Choose a reason for hiding this comment

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

It would seem we have agreed otherwise: #109

- Specification must support flat and hierarchical configuration structure.
- Configuration must explain how to deal with configurations stored in common file formats such as property files, yaml, json.

=== Non-Goals

- Blindly copy MicroProfile Config specification.
- Blindly copy APIs from any of existing configuration frameworks.

=== Resources

- GitHub repository: https://github.com/eclipse-ee4j/config
Copy link
Contributor

Choose a reason for hiding this comment

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

I am not sure we want to include this. I have not seen other spec mention this. Besides the location might change.

Copy link
Contributor

Choose a reason for hiding this comment

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

I suggest to put this info in the readme instead of the spec itself.

- Jakarta EE Specification Project: https://projects.eclipse.org/projects/ee4j.jakartaconfig
- Mailing List: https://accounts.eclipse.org/mailing-list/config-dev

=== Conventions

The keywords 'MUST', 'MUST NOT', 'REQUIRED', 'SHALL', 'SHALL NOT', 'SHOULD', 'SHOULD NOT', 'RECOMMENDED', 'MAY', and 'OPTIONAL' in this document are to be interpreted as described in https://www.ietf.org/rfc/rfc2119.txt[RFC 2119].

Java code and sample data fragments are formatted as shown below:

[source,java]
.Example Java Code
----
package com.example.hello;

public class Hello {
public static void main(String args[]) {
System.out.println("Hello World");
}
}
----

All parts of this specification are normative, except for examples, notes and sections explicitly marked as 'Non-Normative'. Non-normative notes are formatted as shown below:

*Note:* _This is a note._

=== Terminology

7 changes: 2 additions & 5 deletions spec/src/main/asciidoc/02-config.adoc
Original file line number Diff line number Diff line change
@@ -1,9 +1,6 @@
= Jakarta Config Specification
== Specification

== Introduction


== Support Injection
=== Support Injection
A ConfigMapping interface can be injected via the `@Inject`. The following example demonstrates the usage.

[source]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,4 +36,5 @@ endif::[]
include::license-efsl.adoc[]

:sectnums:
include::01-introduction.adoc[]
include::02-config.adoc[]