Develop#4
Merged
Merged
Conversation
…update junit and maven-surefire plugin versions to use property variables
…senter implementation
…pport multiple handlers per event type
… of DomainEventBase
…Base for domain events
…hod for improved service resolution
There was a problem hiding this comment.
Pull request overview
This PR expands the framework’s Spring Boot integration and sample app by wiring OSBA into Spring auto-configuration, adding DDD building blocks (domain events + use case presenter interfaces), and extending the sample with pipeline and user aggregate demos.
Changes:
- Centralize test tool versions in the
uowmodule POM via parent properties. - Add OSBA Spring auto-configuration and ensure the Spring module depends on
osba. - Extend the sample application with datasource config, controllers, and a richer
Useraggregate + supporting DDD types.
Reviewed changes
Copilot reviewed 24 out of 24 changed files in this pull request and generated 7 comments.
Show a summary per file
| File | Description |
|---|---|
| uow/pom.xml | Switches JUnit/Surefire versions to parent properties for consistency. |
| spring/src/main/resources/META-INF/spring/org.springframework.boot.autoconfigure.AutoConfiguration.imports | Registers OSBA configuration for Spring Boot auto-import. |
| spring/src/main/java/com/euonia/osba/OsbaConfiguration.java | Provides an ObjectFactory Spring bean backed by BusinessObjectFactory. |
| spring/pom.xml | Adds com.euonia:osba dependency to the Spring module. |
| sample/src/main/resources/application.yaml | Adds H2 datasource + JPA + error-inclusion configuration for the sample app. |
| sample/src/main/java/com/euonia/sample/SampleApplication.java | Adjusts sample app bootstrap (currently includes commented pipeline import). |
| sample/src/main/java/com/euonia/sample/persistent/UserRepository.java | Adds a placeholder repository interface used by the sample User aggregate. |
| sample/src/main/java/com/euonia/sample/domain/event/UserCreatedEvent.java | Adds a sample domain event emitted on user creation. |
| sample/src/main/java/com/euonia/sample/domain/EditableObjectBase.java | Introduces a sample aggregate base integrating OSBA + domain events. |
| sample/src/main/java/com/euonia/sample/domain/aggregate/User.java | Expands User into a property/rule/event-driven aggregate. |
| sample/src/main/java/com/euonia/sample/controller/UserController.java | Adds REST endpoints for creating/fetching a User via ObjectFactory. |
| sample/src/main/java/com/euonia/sample/controller/PipelineDemoController.java | Adds a pipeline demo REST endpoint using the pipeline module. |
| sample/pom.xml | Adds dependencies on pipeline, domain-driven-design, spring, and H2. |
| osba/src/main/java/com/euonia/factory/BusinessObjectFactory.java | Replaces bean factory function usage with a ServiceResolver. |
| ddd/src/main/java/com/euonia/usecase/UseCaseSuccess.java | Adds a success output port interface for use cases. |
| ddd/src/main/java/com/euonia/usecase/UseCasePresenter.java | Adds a presenter with Flow-based success/failure subscription support. |
| ddd/src/main/java/com/euonia/usecase/UseCaseFailure.java | Adds a failure output port interface for use cases. |
| ddd/src/main/java/com/euonia/usecase/UseCase.java | Adds a basic UseCase<I,O> interface. |
| ddd/src/main/java/com/euonia/domain/HasDomainEvents.java | Adds a domain-events contract for aggregates. |
| ddd/src/main/java/com/euonia/domain/Entity.java | Adds documentation + provides a default getKeys() implementation. |
| ddd/src/main/java/com/euonia/domain/AggregateBase.java | Enhances aggregate base with domain event storage + handler registration. |
| ddd/src/main/java/com/euonia/domain/Aggregate.java | Adds documentation for aggregate roots. |
| ddd/src/main/java/com/euonia/application/BaseApplicationService.java | Adds a base service resolving dependencies and current user via ServiceResolver. |
| ddd/src/main/java/com/euonia/application/ApplicationService.java | Adds a marker interface for application services. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Comment on lines
1
to
+18
| spring: | ||
| application: | ||
| name: sample | ||
| datasource: | ||
| url: jdbc:h2:mem:linkyoudb;DB_CLOSE_DELAY=-1;DB_CLOSE_ON_EXIT=FALSE | ||
| driver-class-name: org.h2.Driver | ||
| username: sa | ||
| password: | ||
| jpa: | ||
| hibernate: | ||
| ddl-auto: update | ||
| show-sql: true | ||
| web: | ||
| error: | ||
| include-exception: true | ||
| include-message: always | ||
| include-binding-errors: always | ||
| include-stacktrace: on-param |
Comment on lines
+3
to
+9
| //import com.euonia.pipeline.spring.PipelineConfiguration; | ||
| import org.springframework.boot.SpringApplication; | ||
| import org.springframework.boot.autoconfigure.SpringBootApplication; | ||
| import org.springframework.context.annotation.Import; | ||
|
|
||
| @SpringBootApplication | ||
| //@Import(PipelineConfiguration.class) |
Comment on lines
+46
to
+48
| public int getAge() { | ||
| return getProperty(age); | ||
| } |
Comment on lines
+21
to
+23
| @DisplayName("User Name") | ||
| @Required(message = "name is valid") | ||
| private final PropertyInfo<String> name = registerProperty(String.class, "name"); |
Comment on lines
+90
to
+104
| public CompletableFuture<Void> executeAsync(RuleContext context) { | ||
| return CompletableFuture.runAsync(() -> { | ||
|
|
||
| if (!(context.getTarget() instanceof User user)) { | ||
| return; | ||
| } | ||
|
|
||
| var name = user.getName(); | ||
|
|
||
| if (name == null || name.trim().isEmpty()) { | ||
| context.addErrorResult(String.format("%s cannot be empty", getProperty().getFriendlyName())); | ||
| } else if (name.length() < 12) { | ||
| context.addErrorResult(String.format("%s must be 12 characters", getProperty().getFriendlyName())); | ||
| } | ||
| }); |
Comment on lines
+21
to
+26
| @PostMapping() | ||
| public ResponseEntity<String> createUser(@RequestBody Map<String, Object> params) { | ||
| var user = factory.create(User.class, params.getOrDefault("name", "Default Name")); | ||
| user.save(false); | ||
| return ResponseEntity.ok("User created with name: " + user.getName()); | ||
| } |
Comment on lines
24
to
29
| /** | ||
| * Configures the BusinessObjectFactory to use the provided bean factory for object instantiation. | ||
| * | ||
| * @param beanFactory the bean factory function to use for creating objects | ||
| * @param resolver the ServiceResolver to be used for resolving services, including the bean factory | ||
| * @return the current instance of BusinessObjectFactory | ||
| */ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.