Questions tagged [delegation]

A delegate is a type that references a method

A delegate is a type that references a method. Once a delegate is assigned a method, it behaves exactly like that method. The delegate method can be used like any other method, with parameters and a return value

719 questions
12
votes
3 answers

delegating into private parts

Sometimes, C++'s notion of privacy just baffles me :-) class Foo { struct Bar; Bar* p; public: Bar* operator->() const { return p; } }; struct Foo::Bar { void baz() { std::cout << "inside baz\n"; …
fredoverflow
  • 237,063
  • 85
  • 359
  • 638
12
votes
2 answers

Method delegation in python

I'm writing a small framework for orchestrating AWS clusters and there are some common hierarchical patterns that appear over and over again. One such pattern is gathering a collection of instances into a bigger object and then delegating some…
David K.
  • 5,703
  • 10
  • 44
  • 76
11
votes
1 answer

Interface delegation on Win64

Documentation states that interface delegation is available for Win32 only. Currently I can't test it, is it documentation bug or interface delegation is discontinued in 64-bit compiler?
kludg
  • 26,590
  • 4
  • 63
  • 115
11
votes
3 answers

How to properly deal with a deallocated delegate of a queued nsoperation

In my current project, several view controllers (like vc) spawn NSOperation objects (like operation) that are executed on a static NSOperationQueue. While the operation is waiting or running, it will report back to the view controller via delegation…
epologee
  • 10,851
  • 9
  • 64
  • 102
11
votes
2 answers

Delphi: How delegate interface implementation to child object?

i have an object which delegates implementation of a particularly complex interface to a child object. This is exactly i think is the job of TAggregatedObject. The "child" object maintains a weak reference to its "controller", and all QueryInterface…
Ian Boyd
  • 220,884
  • 228
  • 805
  • 1,125
11
votes
2 answers

Partial class delegation in Kotlin

How do I partial delegate methods/fields in Kotlin? To be specific: here I am trying to inherit class User from interface TraitA and implement field marked: Boolean in the wrapper StateA. That would clean up the User implementation, because marked…
voddan
  • 26,078
  • 7
  • 69
  • 77
11
votes
1 answer

ASP.NET passing along Windows Authentication credentials

I've got an ASP.NET web application which uses Windows Authentication. This application needs to connect to another ASP.NET web service (which also uses Windows Authentication) and use the same credentials that it received from the user's browser.…
Vilx-
  • 97,629
  • 82
  • 259
  • 398
10
votes
3 answers

Kerberos, delegation and how to do this correctly?

I've got two separate homemade applications that need to communicate among themselves. One is a frontend application (asp.net actually), the other is a backend interface to an accounting application. The backend interface was not created…
Vilx-
  • 97,629
  • 82
  • 259
  • 398
10
votes
1 answer

Access denied impersonating current user accessing network folder

Trying to list the directories and files within a specific folder. This folder will depend on the current user (Page.User) which logs in by Windows Authentication (NTLM) and is retrieved from the Active Directory (homedirectory property). I am using…
Perbert
  • 385
  • 1
  • 5
  • 16
9
votes
4 answers

Objective-C Delegation Explained to a Java Programmer

I am fairly new to Objective-C, but experienced in Java. Is there the equivalent concept of Objective-C "delegation" in Java, so that I may understand this notion better? Would there be a way to emulate the delegation concept in Java?
Julien Chastang
  • 16,970
  • 12
  • 59
  • 88
9
votes
3 answers

Delegating events to a parent view in Backbone

My view, TuneBook, has several child views of type ClosedTune. I also have separate full page views for each tune, OpenTune. The same events are bound within ClosedTune and OpenTune, so I've designed my app so that they both inherit from a shared…
wheresrhys
  • 20,222
  • 16
  • 83
  • 154
8
votes
6 answers

What patterns do you use to decouple interfaces and implementation in C++?

One problem in large C++ projects can be build times. There is some class high up in your dependency tree which you would need to work on, but usually you avoid doing so because every build takes a very long time. You don't necessarily want to…
Tobias
  • 5,950
  • 3
  • 33
  • 60
8
votes
1 answer

How can I delegate an implementation to a mutable property in Kotlin?

As to my understanding, the idea of delegating an implementation in Kotlin is to avoid code that looks like this: class MyClass(val delegate : MyInterface) : MyInterface { override fun myAbstractFun1() = delegate.myAbstractFun1() override…
msrd0
  • 6,403
  • 9
  • 36
  • 64
8
votes
3 answers

How do I configure IIS so that the user's domain credentials are used when connecting to SQL server?

We've recently released the latest version of our intranet application, which now uses windows authentication as standard, and needs to be able to connect to a configured SQL server with the end-user's domain credentials. Lately we've found that on…
Matt Winward
  • 1,195
  • 2
  • 14
  • 38
8
votes
5 answers

How does UITableViewCell communicate with its UITableView?

I am currently creating a custom grid view, which means that I am creating a class that has a lot in common with UITableView. One of the things that I want to get right is the communication of the cells and the grid view. I was therefore wondering…
Bart Jacobs
  • 8,812
  • 7
  • 41
  • 83
1 2
3
47 48