Skip to content
This repository has been archived by the owner on Jun 5, 2020. It is now read-only.

Consider requiring data portal operation methods to be public #930

Open
rockfordlhotka opened this issue Apr 13, 2020 · 5 comments
Open

Comments

@rockfordlhotka
Copy link
Member

Looking forward to CSLA 6 (which will be this fall, with .NET 5 support), @JasonBock and I were discussing a fairly substantial change and I'd like to solicit feedback/input.

Consider requiring data portal operation methods to be public

@Chicagoan2016
Copy link

First a disclaimer; I just started looking at Android, iOS apps using Csla : )
If making data portal methods public would help solve #929 , then I am all for it!
Kind regards

@GillesBer
Copy link

GillesBer commented Apr 14, 2020 via email

@ajj7060
Copy link

ajj7060 commented May 6, 2020

I don't think this is a good idea, personally. I like Csla because it helps encourage good OO design, but making something public just to get rid of a warning which is easily disabled seems like a bad tradeoff. Marking something private is the built-in way of saying "don't call this externally." Plus the method would start showing up in intellisense correct, even though the analyzer would flag calling it?

I thought the reflection results were cached as well, so isn't the already small reflection hit only happening once?

We get the same unused code warnings on all the private setters for read-only business objects, because the data portal methods are compiled out of the version of the business assembly the clients use, I don't see how this is much different.

@brinawebb
Copy link

I agree also, not a good idea. We try to hide things from the consumers of our Library as much as possible (UI developers, people that use our library as an API, etc.). This simplifies their learning curve and eliminates a lot of errors. The less that's there that doesn't work for them anyways, the better, IMO.

@brinawebb
Copy link

First a disclaimer; I just started looking at Android, iOS apps using Csla : )
If making data portal methods public would help solve #929 , then I am all for it!
Kind regards

We encourage using factory methods/criteria instead of DataPortal methods. To us, the criteria is a contract between the factory method and the dataportal method. This works very well. I realize that they may need to be exposed, but our coding standard dictates that DataPortal.Crud calls are only done within the class that owns it.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

5 participants