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

Feature / Domain Layer / Domain Model #93

Merged

Conversation

dncsvr
Copy link
Member

@dncsvr dncsvr commented Jan 9, 2024

Complete implementation of DomainModel for service registration and orm mapping

💡 Discussion

  • As a Proof of Concept, implement a business feature that registers public
    business classes to service collection.
  • Provide an API for features and layers to enumerate on domain types through
    a set of reflection helper classes.

Tasks

  • Register services using domain model in a business feature implementation
    • Add RegisteringServices test fixture
      • Types containing With methods should be registered as transient with singleton factories
      • Types should have no or all dependency parameters in primary constructors are registered as singleton
      • Types with IQueryContext<> dependencies should be registered as singleton
      • Abstract types should not be registered,
      • Static types should not be registered,
      • Value types should not be registered
      • Records should not be registered
      • Exceptions should not be registered
      • System types should not be registered
      • Attributes should not be registered
    • Edit business feature and domain models
      • Add IsAbstract and IsValueType properties to TypeModel
      • Add PropertyModel
      • Add ParameterModel
      • Build TypeModels for interfaces
      • Add custom attribute infos to type and method models
      • Add parameters to method models
      • Return types should be TypeModel
      • Move domain model build logic to BuildDomain phase
      • Add DomainBuilderOptions for configuring build
      • Add AttributeModel
      • OverloadModel for methods and constructors
      • Model child lists should be immutable

@dncsvr dncsvr self-assigned this Jan 9, 2024
@dncsvr dncsvr mentioned this pull request Jan 9, 2024
9 tasks
dncsvr added 19 commits January 9, 2024 16:11
- rename local variables to actual
- minor fixes
- add _IsAbstract_ and _IsValueType_ properties to `TypeModel`
- add `PropertyModel`
- move build logic from model dto's
- edit model dto properties
- add model collection
- add IModel interface
- change IModel.Name => Id
- add custom attributes to type and method
- minor edits and refactoring
- use keyedcollection in model collection
- fix model ids
- minor edits
- add ConfigureDomainOptions extension
- configure options in default business feature
@dncsvr dncsvr requested a review from cihandeniz January 15, 2024 14:58
Copy link
Member

@cihandeniz cihandeniz left a comment

Choose a reason for hiding this comment

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

there is much to review, for now fix these, we'll continue

- remove `ApplicationContext` from `TestServiceSpec`
- remove `GetServiceDescriptor()` extension
- change tests to use stubber to get services
- make ModelCollection.TryGetValue() public
- change TypeModel from record to class
- move IdFromType helper to TypeModel, can be deleted later
dncsvr added 16 commits January 16, 2024 14:20
- change DomainModelExtensions to inline helper methods
- fix `ClassDTO` constructor parameter names
- add `BaseType`to `TypeModel`
-  add `IsAssignableFrom` helper to `TypeModel`
- remove `Distinct()`
- edit model properties to `AttributeModel`
- remove ConstructorModel
- move access properties and returntype to OverloadModel
- add DomainModelBuilder and move build logic from DomainModel
- remove ModelCollection add methods
- DomainOptions => DomainBuilderOptions
- add Init method to TypeModel
- update docs
- remove `ClassDTO` and test case
- remove `IsAssignableTo` helper
- add `GiveMe.TheService<T>` helper
- minor edits
 - minor edits
@dncsvr dncsvr requested a review from cihandeniz January 18, 2024 14:35
@dncsvr dncsvr marked this pull request as ready for review January 18, 2024 14:36
- Remove `AttributeModel`
- Add _FullName_ property to `AssemblyModel`
- Add _FullName_ property to `TypeModel`
- make Id's explicit for models
- make KeyedModelCollection public
- edit DomainModelBuilder => use KeyedModelCollection
 - use GiveMe.The helpers
- remove TheService helper
- remove type is built conventions from `DomainBuilderOptions`
- remove Type and Assembly descriptors
@dncsvr dncsvr merged commit b72ae68 into mouseless:epic/domain-layer Jan 18, 2024
5 checks passed
@dncsvr dncsvr deleted the feature/domain-layer/domain-model branch January 18, 2024 16:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants