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
1
vote
1 answer

why my poco entity isn't a proxy?

I can't figure out the reason of the strange behaviour of my entity. I'm using POCO classes generated from the database with the dbContext template introduced with the CTP5. In my DbContext I have several entities and when I use them, they are…
stuzzo
  • 1,056
  • 1
  • 15
  • 36
1
vote
3 answers

Extending auth.User model, proxied fields, and Django admin

(Edit: I know that there's a totally separate feature in Django called "Proxy Models". That feature doesn't help me, because I need to be able to add fields to UserProfile.) So I'm starting a new Django app and I'm creating a UserProfile model…
rfrankel
  • 675
  • 8
  • 20
1
vote
1 answer

why do Realm generate proxy classes for all the model class?

I am trying to understand how does Realm for Android works under the hood. when I used the custom methods in our model class, couldn't see them in the generated proxy class.
1
vote
1 answer

Implementing .Net DI Compile Time Proxies?

I'm not so much seeking a specific implementation but trying to figure out the proper terms for what I'm trying to do so I can properly research the topic. I have a bunch of interfaces and those interfaces are implemented by controllers,…
Spencer Ruport
  • 34,865
  • 12
  • 85
  • 147
1
vote
1 answer

How to get sqlSession instance in mybatis mapper proxy?

I have a mybatis mapper public interface FooMapper { @Select("select now()") String getTime(); } when debug I got below info I want to get sqlSession instance. So I tried using reflection manner to get sqlSession. Field hField =…
zhuguowei
  • 8,401
  • 16
  • 70
  • 106
1
vote
1 answer

Creating a proxy class in Python in another class

I'm trying to get a proxy class working, but it does not really want to work. The class that I want to proxy is the following: import zmq class ZmqPublish(): def __init__(self): self.context = None self.pub_socket = None …
1
vote
1 answer

Unexpected proxy objects in Nhibernate with composite ID's

I have a data structure which uses composite ids (Which I dont wish to change to single) Everything loads fine except for many-to-one joins which if the join is empty, instead of mapping the property to null, maps it to an empty proxy object. I have…
user54151
  • 13
  • 4
1
vote
2 answers

Typescript object wrapping, typings and generics

This is somewhat the transformation of a question I posted somewhere else yesterday. My objective is not to get a working result but to have a better understanding of the kind of design I can obtain while returning the correct types. This by using…
arvymetal
  • 2,787
  • 1
  • 30
  • 39
1
vote
0 answers

Dynamically Implementing Interface Java

So I'm trying to create a little Util that lets me dynamically implement an interface in Java. What I mean by that is, I would like to take an object and forcibly upcast it to another object. Obviously, that's not possible unless all the required…
Exerosis
  • 33
  • 8
1
vote
1 answer

Derive Interfaces for WCF Proxy Classes

Problem: I have two (or more) classes which are very similar: The properties of one class are a subset of the properties of the other class. More specifically, the property names and semantics are equal, but not necessarily their types. However, if…
jfs
  • 293
  • 1
  • 3
  • 9
1
vote
1 answer

Proxy Objects with ActiveRecord models - method_missing not working sometimes

I've been using a model of my application as a proxy to other objects that define behavior. class Box < ActiveRecord::Base belongs_to :box_behavior, :polymorphic => true, :validate => true, :foreign_key => 'box_behavior_id', :dependent =>…
Lucas d. Prim
  • 787
  • 1
  • 5
  • 17
1
vote
3 answers

C++: Proxy to set/get array value with a complex conjugate

I'm writing a class for Hermitian matrices. This is a complex matrix that has only n*(n+1)/2 independent complex numbers (ignoring details about the diagonal being exactly real). My plan is to write only the upper triangular elements, where row…
The Quantum Physicist
  • 24,987
  • 19
  • 103
  • 189
1
vote
0 answers

Proxy target property being set to proxy property counterpart

Let's say I've the following code sample: public class A { public virtual string Text { get; set; } } And I generate a proxy of A: A aProxy = ... // Code to generate the whole proxy aProxy.Text = "hello world"; Now I cast aProxy to gets its…
Matías Fidemraizer
  • 63,804
  • 18
  • 124
  • 206
1
vote
3 answers

Java 7 - custom method decoration without default delegating all, other, many methods

I'd like to decorate the interface PreparedStatement, in order to custom close it (just an example). This means that I want to decorate an existing instance of PreparedStatement, thus, invoking other code, when close() is being invoked. For that, I…
AlikElzin-kilaka
  • 34,335
  • 35
  • 194
  • 277
1
vote
0 answers

How to reimplement the fixModel function of QAbstractProxyModel (Qt)?

I have subclassed QAbstractTableModel into MyModel and implemented all the needed functions. This works fine. However I would like to filter MyModel. I've tried QSortFilterProxyModel to filter the items. This does the job quite well but when I…
phodina
  • 1,341
  • 1
  • 12
  • 25