Questions tagged [proxy-classes]

A proxy class is a class functioning as an interface to another class or a service. Proxy classes are implementation of Proxy design pattern. These classes help using large objects or other resources that are expensive or impossible to duplicate.

342 questions
6
votes
3 answers

Force .NET webservice to use local object class, not proxy class

I have a webservice that I'm calling from a windows forms application (both .NET, both in the same solution), and I'd like my webservice to return a custom object from elsewhere in the project - it's a common object that they both share a reference…
SqlRyan
  • 33,116
  • 33
  • 114
  • 199
6
votes
3 answers

Serializing a proxy class to file

I have a proxy (generated either as a JDKProxy or a CGLIB one) that is generated at runtime in the JVM. I wanted to know if there is a way to write the contents of this class (which looks like com.sun.proxy$Proxy123.class) to a file so that I may…
Kilokahn
  • 2,281
  • 1
  • 25
  • 50
6
votes
6 answers

Avoid calling RaisePropertyChanged in every setter

I want to get rid of the space consuming and repetitive RaisePropertyChanged-Properties on my model classes. I want my model class... public class ProductWorkItem : NotificationObject { private string name; public string Name { …
tweakch
  • 426
  • 3
  • 13
6
votes
2 answers

@Cacheable breaks DependencyInjection

I stumbled upon a case where the AOP proxy created by using @Cacheable breaks the dependency injection in Spring 3.1.1. Here is my scenario: I have an interface and a class implementing this interface using @Cacheable at the implemented…
kpentchev
  • 3,040
  • 2
  • 24
  • 41
5
votes
1 answer

Incorrect view of custom hierarchical model when set proxy model that swap columns

I have custom hierarchical model, inherited from QAbstractModelItem. Also, I implement MySortFilterProxyModel subclassed from QSortFilterProxyModel. MySortFilterProxyModel can remove and swap columns. If first column in MySortFilterProxyModel…
typbl4
  • 141
  • 8
5
votes
2 answers

TypeError: 'ownKeys' on proxy: trap result did not include 'arguments'

What do it wants from me? How to make it work? var proxy_handler = { ownKeys: function(target) { return Object.keys(target.data) }, } var proxxxy = function(initial_data) { var return_value = "Goodbye world" var target…
user619271
  • 4,766
  • 5
  • 30
  • 35
5
votes
1 answer

Hibernate proxy generation

I was going through the documentation for hibernate and found these lines The no-argument constructor is a requirement for all persistent classes; Hibernate has to create objects for you, using Java Reflection. The constructor can be private,…
Bharat Bisht
  • 109
  • 1
  • 7
5
votes
1 answer

In golang, How can I override the embedded struct's method

Code here package main import "fmt" func main() { t16() } type Base struct { val int } func (b *Base)Set(i int) { b.val = i } type Sub struct { Base changed bool } func (b *Sub)Set(i int) { b.val = i b.changed =…
wener
  • 7,191
  • 6
  • 54
  • 78
5
votes
2 answers

What is a .NET proxy object in the Inversion of Control / Aspect-Oriented sense?

What is a proxy object in the Inversion of Control / Aspect-Oriented sense? Any good articles on what a proxy object is ? Why you would want to use one ? And how to write one in C# ?
BuddyJoe
  • 69,735
  • 114
  • 291
  • 466
5
votes
2 answers

How does vector deal with references and iterators?

As we all probably know the C++ 98 vector specialization stores boolean values as bits rather than as bool variables. vector's elements aren't addressable because C++ doesn't have pointers and references to bits, is there a workaround to…
iKlsR
  • 2,642
  • 6
  • 27
  • 45
4
votes
2 answers

Wcf Service Proxy Name / Namespace naming strategy

Anyone have a naming strategy that works well for service proxy classes? For example, if I am given three web services within two projects as follows: XWs AService.asmx YWs BService.svc CService.svc What would use as the Service Reference…
Ruben Bartelink
  • 59,778
  • 26
  • 187
  • 249
4
votes
1 answer

NHibernate ObjectProxy casting with Lazy Loading

I defines: [ActiveRecord("BaseEntity", Lazy = true )] class BaseClass {} [ActiveRecord("DerivedEntity", Lazy = true )] class DerivedClass : BaseClass {} In DB BaseEntity and DerivedEntity are 1=1 I create: BaseClass myClass = New…
manuellt
  • 669
  • 2
  • 7
  • 19
4
votes
4 answers

Is a proxy class the same as a class wrapper?

I have to access a legacy database that has "generic" tables in it and I do not have the authority to change it. Depending on the customer data that I'm working with, the relationships between the tables may differ. So, customerA may join to the…
user134363
4
votes
4 answers

In Java, how can I construct a "proxy wrapper" around an object which invokes a method upon changing a property?

I'm looking for something similar to the Proxy pattern or the Dynamic Proxy Classes, only that I don't want to intercept method calls before they are invoked on the real object, but rather I'd like to intercept properties that are being changed. I'd…
Hanno Fietz
  • 30,799
  • 47
  • 148
  • 234
4
votes
1 answer

Why is Kotlin throw IllegalArgumentException when using Proxy

This is the Kotlin equivalent of Java code using InvocationHandler: override fun invoke(proxy: Any?, method: Method?, args: Array?): Any { println("before httprequest--->" + args) val ret = method!!.invoke(obj, args) …
WenChao
  • 3,586
  • 6
  • 32
  • 46