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.
Questions tagged [proxy-classes]
342 questions
8
votes
3 answers
Proxy object/reference getters vs setters?
When I am designing a generic class, I am often in dilemma between the following design choices:
template
class ClassWithSetter {
public:
T x() const; // getter/accessor for x
void set_x(const T& x);
...
};
// vs
template

eold
- 5,972
- 11
- 56
- 75
8
votes
1 answer
spring, how to change cglib naming policy
When spring creates a proxy, it uses cglib with default naming policy. Is there any way to change the naming policy? Generated class names clash with another framework I use.

piotrek
- 13,982
- 13
- 79
- 165
8
votes
2 answers
binding.pry in BasicObject
pry would be great for debugging a subclass of BasicObject !
https://github.com/pry/pry says that pry has:
"Exotic object support (BasicObject instances..."
But how to do that?
As can be expected a BasicObject does not understand binding.
…

Ernst
- 235
- 2
- 12
8
votes
3 answers
Automatic Proxy Class
Assume I have an interface
class I{
public:
virtual void f(int id)=0;
virtual void g(int id, float x)=0;
}
I need a proxy class, to do some sort of id to pointer mapping
class Proxy : I
{
I * i[5];
public:
void f(int id)
{
…

Volkan
- 89
- 6
7
votes
2 answers
django model polymorphism with proxy inheritance
My Discount model describes common fields for all types of discounts in the system. I have some proxy models which describe concrete algorithm for culculating total. Base Discount class has a member field named type, which is a string identifing its…

aambrozkiewicz
- 542
- 3
- 14
7
votes
1 answer
Loading from database without proxy classes?
In Entity Framework 4 Is it possible to choose to load some queries into a POCO without it using proxy classes? (For the purpose of caching that object for future read only use). I am using the Repository - Service pattern.
By this I mean:
var…

JK.
- 21,477
- 35
- 135
- 214
7
votes
3 answers
Django inheritance and polymorphism with proxy models
I'm working on a Django project that I did not start and I am facing a problem of inheritance.
I have a big model (simplified in the example) called MyModel that is supposed to represents different kind of items.
All the instance objects of MyModel…

Leonardo
- 4,046
- 5
- 44
- 85
7
votes
1 answer
Web Service proxy class to implement interface
I am looking for a way to have the generated proxy class for a Web Reference (not WCF) implement a common interface in order to easily switch between web service access and "direct" access to our business layer in the client application, something…

bernhof
- 6,219
- 2
- 45
- 71
7
votes
1 answer
What is the use of the nested pointer type in iterator_traits?
The std::iterator_traits class template defines 5 nested types: iterator_category, value_type, difference_type, pointer and reference. Browsing the sources of the header of both libc++ and libstdc++, one can see many uses of value_type,…

TemplateRex
- 69,038
- 19
- 164
- 304
7
votes
1 answer
How to use java proxy in scala
I have an interface as Iface that has two methods written in java. That interface is an inner interface of Zzz class.
I have written the invocation handler in scala. Then I tried to create a new proxy instance in scala like below.
val handler = new…

bula
- 8,719
- 5
- 27
- 44
7
votes
2 answers
Are CXF client proxies thread safe?
I'm using CXF to generate SOAP client classes. In the CXF documentation, they write
Are JAX-WS client proxies thread safe?
Official JAX-WS answer: No. According to the JAX-WS spec, the client proxies are NOT thread safe. To write portable code, you…

Eyal
- 3,412
- 1
- 44
- 60
7
votes
3 answers
How do I serialize all properties of an NHibernate-mapped object?
I have some web methods that return my objects back as serialized XML. It is only serializing the NHibernate-mapped properties of the object... anyone have some insight? It seems to be that the web methods are actually serializing the NHibernate…

wprl
- 24,489
- 11
- 55
- 70
6
votes
1 answer
Why do some assignment operators for the helper classes of std::valarray return void?
For example, the assignment operators for std::slice_array:
void operator=(const valarray&) const; //#1
void operator=(const T&) const; //#2
const slice_array& operator=(const slice_array&) const; //#3
#1 and #2 return void, but #3 returns const…

Blackteahamburger
- 595
- 1
- 18
6
votes
1 answer
How to dynamically generate a stack frame with debug log information
For better debugging, I would often like to have:
Exception
at com.example.blah.Something.method()
at com.example.blah.Xyz.otherMethod()
at com.example.hello.World.foo()
at com.example.debug.version_3_8_0.debug_info_something.Hah.method()…

Lukas Eder
- 211,314
- 129
- 689
- 1,509
6
votes
2 answers
Design to prevent magic numbers and strings
I am building a service that retrieves from and submits to a third party. The third party delivers a complex data model which includes three different status types, all of them integers with an obscure number series. An example is provided below…

Marius Agur
- 272
- 3
- 11