Skip to main content

Questions tagged [delegates]

0 votes
2 answers
301 views

Example: The MacOS API known as Cocoa uses Delegation to specify various behaviors within the app. A Delegate is a separate object that implements a set of methods that are called by an original ...
CPlus's user avatar
  • 1,219
-2 votes
1 answer
168 views

AWS Amazon.S3.Model.PutObjectRequest is merely a 3rd-party AWS Data Transfer Object (DTO) / Plain Old C# Object (POCO) type that can be used to build a request that can be used to send requests to an ...
user1338998's user avatar
2 votes
1 answer
215 views

Please consider the following sample #include <cstdio> #include <functional> #include <memory> #include <utility> class PaintDelegate { public: virtual ~...
Zoso's user avatar
  • 251
2 votes
1 answer
203 views

I have these lines in multiple test methods. Now, trying to create a private method to clean up but not sure how to do it. Any suggestion or pointer would be really helpful. Thanks. var ...
Sharif Mamun's user avatar
38 votes
10 answers
10k views

As has been covered to the point of parody, heavily object-oriented languages, such as C# or Java, tend to lack the feature of having functions as a primitive type. You can argue about whether or not ...
J. Mini's user avatar
  • 1,015
0 votes
2 answers
63 views

In other words, should the raising of an HTTP 4xx code be considered an error, and should the job of sending an HTTP 4xx code to a client be delegated to an error handler? Or is it simpler to just ...
Asker's user avatar
  • 109
4 votes
1 answer
2k views

I'm reading some article about "prefer composition over inheritance", and heard about Forwarding and Delegation. After search for the different I found some source: https://en.wikipedia.org/wiki/...
nhoxbypass's user avatar
0 votes
2 answers
611 views

I have to use a built-in API that works like this class MyAPIWrapper { func callAPI() { apiObj.delegate = self apiObj.doWork() // returns immediately, eventually calls self.delegate....
Max's user avatar
  • 186
13 votes
1 answer
5k views

As a Ruby/Rails person, I often deal with method delegation. It's often convenient to delegate a method to a composed object or a constant. Ruby even has a def_delegator helper method to easily build ...
art-solopov's user avatar
0 votes
2 answers
548 views

My question relates to usage of delegation together with inheritance and dependency injection. I have a MailerService class that requires a delegate in order to do its job. Furthermore, I have a ...
balteo's user avatar
  • 191
-1 votes
1 answer
75 views

Consider this code: new FrameworkClass( [ 'query' => $_POST[ 'input' ] ] ); FrameworkClass is supposed to do input sanitization and validation. Should we just trust 3rd party code to do it's job? ...
Hans's user avatar
  • 572
2 votes
2 answers
4k views

Is there any fundamental difference between to using an action and a list of actions? Seeing that action is a delegate and therefore is a list itself. For instance: List<Action> ...
johnny 5's user avatar
  • 335
0 votes
1 answer
342 views

I currently have the following set up where I have 2 or 3 classes implementing IZoneController and I have a set of conditions determining which function they need to execute when called. I first ...
Daniel Shank's user avatar
-1 votes
3 answers
450 views

I am developing two libraries in .Net Firs one it's a library with core functionality (named it Library.Core.dll) Let's focus in User class public class User { //set of constructors and ...
X.Otano's user avatar
  • 622

15 30 50 per page
1
2 3 4 5