Let's use the observer pattern to build a pub-sub type application in the Salesforce Apex programming language. github.com/bdJ...
Пікірлер: 12
@dzmitryvarabei67002 жыл бұрын
I think observerCollection property wan't implemented in ProductSubject class. How it was intended to use this property? And sorry if it was explained in the video, I just didn't catch.
@softwareengineeringandsale40052 жыл бұрын
I think i did a bad job with this. Because there was only one type in the video i skipped it.
@PuerinTheHunter2 жыл бұрын
Brooks, that ProductObserver.notify() is running a query, but it is called from ProductSubject.notifyObservers() and that itself is called from within a loop in ProductCatalogTriggerHandler. The result is a query within a loop which should be avoided.
@softwareengineeringandsale40052 жыл бұрын
You are totally correct and thanks for calling that out. i was so busy trying to wrap up the video I didn’t catch it.
@olaitanadesoji37192 жыл бұрын
I just watched the video and this is exactly what rang in my head .. Good someone else catched.. But still Great teaching moment by @Software Engineering and Salesforce
@petargechev18522 жыл бұрын
@banderson51442 жыл бұрын
This is a very nice use case of the wire adapter/decorator in LWC as well to have the call automatically happen as well. Did you think about also possibly using platform events for this scenario as well
@softwareengineeringandsale40052 жыл бұрын
I did and i mention in the video that platform events are another way to do this. But for simplicity’s sake i implemented with a trigger.
@vetealaurent33802 жыл бұрын
great stuff ! Any particular reason going asynchronous for subscribeUser() in the JS controller ?
@softwareengineeringandsale40052 жыл бұрын
it’s just syntactic sugar for promises. I find it easier to work with.
@bakshirocks2 жыл бұрын
Great content as always. I have a doubt in on if your earlier design patter videos. You mentioned that abstract classes can NOT be instantiated but still you were able to instantiate the Pizza abstract class in that video. Can you please check and explain.?
@softwareengineeringandsale40052 жыл бұрын
Did you mean to post this one here? No abstract classes in the video.