Skip to content
This repository has been archived by the owner on Feb 10, 2024. It is now read-only.

Designing a Core Framework for Application Composition and Lifecycle Management #79

Open
thejhh opened this issue Jun 3, 2023 · 0 comments
Labels
design Design work

Comments

@thejhh
Copy link
Contributor

thejhh commented Jun 3, 2023

In order to achieve application compotization and effective lifecycle management, we are developing a TypeScript framework inspired by Java Spring Boot's concept of "Beans."

The primary objective of this framework is to break down application features into small, independent, and easily testable units. It will empower developers to compose these units seamlessly, creating a cohesive and functional product.

To ensure the success of this TypeScript implementation, we need to address the following key features:

  1. HgApplication.run(): This method will be responsible for implementing the logic currently hardcoded in the project-specific ./main.ts file.

  2. @Application Annotation: By introducing this annotation, developers can define the main class or function for applications. It will be utilized within the HgApplication.run() method.

  3. @Component and @Service Annotations: These annotations will allow developers to tag classes, providing optional categorization for better organization and code clarity.

  4. @Autowired Annotation: By employing this annotation, parameters, properties, and setters will be automatically wired based on their types. This will simplify dependency injection and improve code modularity. See Autowired annotation #96.

  5. @Qualifier Annotation: This annotation will assist in resolving potential type conflicts by allowing developers to specify which type should be selected when multiple options are available.

  6. Common Interfaces: We will define standard methods for lifecycle management, such as Disposable, which can be implemented by classes. These interfaces will promote consistency and provide a clear contract for developers.

  7. Lifecycle Annotations: In addition to the common interfaces, we will introduce lifecycle annotations like @PreDestroy, enabling developers to define custom methods that adhere to our lifecycle standards.

  8. Configurator Feature: This feature will offer dynamic autowire conflict resolution. For example, developers will be able to select the preferred database solution from multiple options, allowing end-users to customize their environment.

For further insights and references, please refer to the following resources:

By incorporating these features, our TypeScript framework will facilitate application compotization and streamline the management of application lifecycles.

@thejhh thejhh changed the title Core framework to implement application compotization and life cycle Designing a Core Framework for Application Composition and Lifecycle Management Jun 3, 2023
@thejhh thejhh added the design Design work label Jun 3, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
design Design work
Projects
None yet
Development

No branches or pull requests

1 participant