Any ideas for an overridable method or event (existing or theoretical) signaling arrived back on the client side? #3541
-
Asking as a separate question worded differently to see if fresh ideas bubble up (see this for history) I've racked my brain since CSLA 6 release trying to figure out where if anywhere I could or would have some reliable place in code to detect that we are back on the client AFTER a DataPortal call AND where I would have access to interesting relevant things like:
Ideally this mysterious method/event would happen only once per call to the DataPortal Is this making any sense? As a reminder: for server side - we already have several methods/events like |
Beta Was this translation helpful? Give feedback.
Replies: 4 comments 8 replies
-
It occurs to me that someone might think "Well you've already got what you asked about in the response of all calls to a DataPortal.Fetch or Create etc.". Well yes, I could code a common handler into every CRUD operation method on every business object...which would be several hundred x 4...that's a lot of boiler plate code to add. Ideally there is some way to add a hook ONCE to the Example: maybe all my business objects implement an interface that adds a common property (implemented in the base class) which if true on the way back from the data portal means do some action. |
Beta Was this translation helpful? Give feedback.
-
There used to be some static events when Now in modern CSLA, with each instance of Normally your calling code is like this: // got portal via injection
myResult = await portal.FetchAsync();
// more code In that context it isn't clear to me what an event would add, given that you know when the result returns because the "more code" only runs after the result is back. Where would you use an event here? (and you might say that it is useful in some MVVM scenarios - and I agree - which is why the various CSLA |
Beta Was this translation helpful? Give feedback.
-
The later is what I’m after, So a subclassed proxy that watches all the
objects
…On Wed, Nov 8, 2023 at 10:11 PM Rockford Lhotka ***@***.***> wrote:
Is your goal for individual domain business objects to be aware that
they've rematerialized on the client?
Or for a subclass of a proxy to be aware that an object graph has
rematerialized on the client?
—
Reply to this email directly, view it on GitHub
<#3541 (reply in thread)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/ABUM5P5P4CBPH2ADCZC7QSTYDRQZ5AVCNFSM6AAAAAA7CDQXKWVHI2DSMVQWIX3LMV43SRDJONRXK43TNFXW4Q3PNVWWK3TUHM3TKMJYGE3DM>
.
You are receiving this because you authored the thread.Message ID:
***@***.***>
|
Beta Was this translation helpful? Give feedback.
-
Well I should say at first I didn’t know where it was possible or best to
hook in - but now that I’ve spent a bunch of time in the Csla guts I see
the proxy seems the most natural place for what I’m thinking.
But to your question- the proxy could certainly tell the object he is on
the client through some base class method. That might come in handy
someday although I don’t have a use case for that currently.
…On Wed, Nov 8, 2023 at 10:11 PM Rockford Lhotka ***@***.***> wrote:
Is your goal for individual domain business objects to be aware that
they've rematerialized on the client?
Or for a subclass of a proxy to be aware that an object graph has
rematerialized on the client?
—
Reply to this email directly, view it on GitHub
<#3541 (reply in thread)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/ABUM5P5P4CBPH2ADCZC7QSTYDRQZ5AVCNFSM6AAAAAA7CDQXKWVHI2DSMVQWIX3LMV43SRDJONRXK43TNFXW4Q3PNVWWK3TUHM3TKMJYGE3DM>
.
You are receiving this because you authored the thread.Message ID:
***@***.***>
|
Beta Was this translation helpful? Give feedback.
To specifically focus on your core request, what you are describing sounds like a side-effect, where you called the data portal to do one thing, and it also did something else.
That's not good, at least as a general practice. I'm not keen on directly supporting side-effects that aren't explicitly part of the domain model.
Which is to say that I think your scenario(s) should be explicitly part of your business domain model, not part of the infrastructure.