vkhorikov / CSharpFunctionalExtensions

Functional extensions for C#
MIT License
2.45k stars 304 forks source link

Proposal: Move Entity and ValueObject to a separate nuget #389

Open AlexanderDorofeev opened 2 years ago

AlexanderDorofeev commented 2 years ago

Vladimir, it looks like Entity and ValueObject are not a part of language extensions. They are a part of the domain layer building block. And there is a conflict in responsibilities. Not all domain models rely on functional programming style, also we don't need domain classes in all projects, that use functional programming style. So it looks reasonable to extract these classes into separate domain building block\nuget and it would be nice to have your specification pattern there, cos it is part of a domain. What do you think about that?

vkhorikov commented 2 years ago

Yes, I plan to do this ( https://github.com/vkhorikov/CSharpFunctionalExtensions/issues/323#issuecomment-916041498 ), but not sure when I'd be able to implement such a split, the project will need to be carefully split in pieces while preserving backward compatibility.

mohaaron commented 1 month ago

@vkhorikov,

I would also like to add to this request that I would like to have the Maybe and Result put into separate Nuget packages. My reason for this is due to the fact that I'm using my own Result object and have naming collisions when using the library namespace which contains all of them. Even just moving them into their own namespace would help.

vkhorikov commented 2 days ago

@mohaaron could you elaborate on why you are using 2 result implementations?

mohaaron commented 2 days ago

I was trying to use just the Maybe to start with, and then the ValueObject and Entity. I didn't realize at first that I would get a naming conflict with the Result since I already have one. Maybe I'll switch to using yours but I didn't want to rewrite it all now

vkhorikov commented 2 days ago

I see. I suggest to either switch to the library's version fully, or just copy Maybe and ValueObject to your project instead. Changing namespaces in the library would bring too many breaking changes unfortunately.

mohaaron commented 2 days ago

Thank you for the feedback. I'll do that for now