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

Mark CriteriaBase with a soft obsolete attribute #4462

Closed
rockfordlhotka opened this issue Jan 27, 2025 · 0 comments · Fixed by #4467
Closed

Mark CriteriaBase with a soft obsolete attribute #4462

rockfordlhotka opened this issue Jan 27, 2025 · 0 comments · Fixed by #4467
Assignees

Comments

@rockfordlhotka
Copy link
Member

Just to be sure:
A criteria object is inteded to be instantiated with new and not through a dataporal, correct?

If yes, the FieldManager needs an ApplicationContext in it's constructor. But because the criteria isn't instantiated through a data portal it has none.
My current way around that is a new bool to indicate whether the current object type (e.g. Criteria) has the need of a fully functional ApplicationContext or not. Depending on that I've introduced a new DummyApplicationContext with a private constructor which is just there to satisfy the need of an ApplicationContext. But the instance itself is not capable of doing any work because it's not correctly instantiated.
That's hell of an ugly workaround but I currently do not see any other way without breaking all criteria users.
Tbh I'm inclined with the new way serialization works to make criterias obsolete and promote POCO types as criterias. Less code on our side and our users side and no dependencies on any framework stuff because it's a POCO.

What do you think about marking CriteriaBase<T> as obsolete (maybe in v9 already?). And we drop it in v11 or later so people have enough time to migrate to the new POCO serialization?

Originally posted by @StefanOssendorf in #1233

@rockfordlhotka rockfordlhotka moved this from Todo to In Progress in CSLA Version 9.0.0 Feb 3, 2025
@rockfordlhotka rockfordlhotka self-assigned this Feb 3, 2025
rockfordlhotka added a commit that referenced this issue Feb 6, 2025
* #3785 Update samples for rc4

* #3785 Update samples for rc4

* #3785 Update samples for rc4

* #3785 Update samples for rc4

* #4462 Mark CriteriaBase as obsolete

* #4462 Enhance docs around CriteriaBase and serialization of types

---------

Co-authored-by: Stefan Ossendorf <StefanOssendorf@users.noreply.github.com>
@github-project-automation github-project-automation bot moved this from In Progress to Done in CSLA Version 9.0.0 Feb 6, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
No open projects
Development

Successfully merging a pull request may close this issue.

1 participant