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

761 questions
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,255
  • 2
  • 15
  • 43
8
votes
2 answers

How can I get the name of a Kotlin property?

I have the following function to access a property's delegate. It uses Kotlin reflection to get a property's name and Java reflection to get the field. fun Any.getDelegate(prop: KProperty): Any { return…
Michael Pardo
  • 2,590
  • 3
  • 24
  • 33
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
  • 9,022
  • 7
  • 47
  • 88
7
votes
4 answers

Clarity in classes implementing multiple interfaces (alternative to delegation):

Let's say we've got the following: IFirst = Interface(IUnknown) function GetStuff: Integer; end; ISecond = Interface(IUnknown) function GetOtherStuff: Integer; end; TFirstSecond = class(TInterfacedObject, IFirst, ISecond) …
Vector
  • 10,879
  • 12
  • 61
  • 101
7
votes
2 answers

How to use delegate method for more than two associations?

Let's say that I'm retrieving the name of the sport by calling the following chain of associations: pick.event.league.sport.name How can I use the delegate method so that I can just call *pick.event_league_sport_name* like so? Obviously, I can…
keruilin
  • 16,782
  • 34
  • 108
  • 175
7
votes
1 answer

Is a protocol either a reference or value type in Swift?

The reason I ask this question is because I'm reading a tutorial that uses delegation. Based on what I've read from other tutorials/articles online, to my knowledge this specific tutorial hasn't created a retain cycle. I also tested it by using…
Laurence Wingo
  • 3,912
  • 7
  • 33
  • 61
7
votes
2 answers

What is delegation? When would I want to use it?

In OOP, a term delegation is mentioned. How is this modelled in a class? I searched on yahoo etc but got links to delegates.
GurdeepS
  • 65,107
  • 109
  • 251
  • 387
7
votes
2 answers

Kotlin: function delegation

I have a project that depends heavily on delegation and composition in Kotlin. Delegating properties is a breeze, but conceptually I'm not completely sure how to achieve delegation for functions in circumstances where the functions depend on other…
mikesol
  • 1,177
  • 1
  • 11
  • 20
7
votes
1 answer

How do I add an event listener to all the childnodes of a div in and array of those div?

I'm teaching myself JS and trying to avoid jQuery until my JS skills are better. Goal: add an eventlistener, for click event, to all the divs of a certain class. Have all the child nodes of that class respond to the event. My HTML
Tamb
  • 748
  • 11
  • 20
7
votes
4 answers

Stop propagation with jQuery delegate/live function not working

Here's the problem html:
7
votes
1 answer

SharePoint 2013 / IIS 7.5 Impersonation/Delegation/Double Hop

Ok, I have spent about 15 hours trying to resolve this problem and I have finally been resigned to posting here to try to get it resolved. I know this post is very long but I have done all the normal things that I'm going to be told to try so I…
6
votes
1 answer

OpenID Connect: Passing authorization between a mobile app and a browser for SSO - what's a secure way to do it?

I'm not sure there is a "proper" way, but before I just bodge together my own incompatible implementation, perhaps there's something in all the standards that can fit my need? Here's the situation: Apple has declared that apps on their phones MUST…
Vilx-
  • 104,512
  • 87
  • 279
  • 422
6
votes
2 answers

Perl OO using Moose - best way to code delegation example?

Perl's Moose is different from other object systems, so it's not always clear how to translate an example known from other languages into Moose lingo. Consider the following Java example of Rectangle and Square, where a Square instance (a square…
Lumi
  • 14,775
  • 8
  • 59
  • 92
6
votes
2 answers

How to convert Delegate to Observable RxSwift?

I have delegate methods, which I need to wrap by Delegate Proxy in RxSwift. I have done it using Bond and Reactive, but here, in RxSwift, I am not able to find the proper way to convert it. Follow is Protocols import UIKit /** A protocol for…
Sam Shaikh
  • 1,596
  • 6
  • 29
  • 53
6
votes
2 answers

Kotlin: How can I use delegated properties in Java?

I know that you can't use the delegated property syntax in Java, and won't get the convenience of "overriding" the set/get operators as in Kotlin, but I'd still like to use an existing property delegate in Java. For instance, a simple delegate of an…
Jire
  • 9,680
  • 14
  • 52
  • 87