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
4
votes
2 answers

Easy way to dynamically invoke web services (without JDK or proxy classes)

In Python I can consume a web service so easily: from suds.client import Client client = Client('http://www.example.org/MyService/wsdl/myservice.wsdl') #create client result = client.service.myWSMethod("Bubi", 15) #invoke method print result …
bluish
  • 26,356
  • 27
  • 122
  • 180
4
votes
1 answer

How to create a dynamic proxy with polymorphic delegation?

I want to create a dynamic proxy, which can delegate its methods to different implementations (each method invocation chooses a potentially different object). And I want to achieve the polymorphic effect, like when some proxied method calls another…
vadipp
  • 877
  • 1
  • 12
  • 22
4
votes
2 answers

Alternatives to wsdl.exe for creating proxy classes from wsdl

wsdl.exe, appears to be the default tool for .Net to generate proxy class from wsdl. It has known problems (see here and here, also some SO questions). Is there an alternative proxy class generator? I am not doing WCF, so tools such as svcutil.exe…
Graviton
  • 81,782
  • 146
  • 424
  • 602
3
votes
4 answers

Proxy pattern - Applicability & Examples

From here: http://www.oodesign.com/proxy-pattern.html Applicability & Examples The Proxy design pattern is applicable when there is a need to control access to an Object, as well as when there is a need for a sophisticated reference to an…
Aquarius_Girl
  • 21,790
  • 65
  • 230
  • 411
3
votes
1 answer

Why are pure inheritance based proxies bad in AoP

I have a problem making method calls between methods in same class and having transaction advice apply. Spring Framework .NET documentation states that it supports compositional and inheritance based proxies and that you can force spring to create…
Nikola Radosavljević
  • 6,871
  • 32
  • 44
3
votes
2 answers

How do I automatically cast a class instance to Float in Ruby?

I have an Angle class that I want to behave like a float, with additional behavior. I have created the class to contain a float and proxy all unknown methods to it: class Angle include Math def initialize(angle=0.0) @angle = Float(angle) …
Brian Wong
  • 140
  • 2
  • 7
3
votes
1 answer

WCF HashSet changes into a int[] when creating service reference

I am using a HashSet in my WCF interface [ServiceContract] public interface IwcfServerSync { [OperationContract] void Test(HashSet someHashSet); } When I create a service reference the HashSet turns into a int[]. I added a…
Asaf
3
votes
3 answers

How to create a NHibernate proxy object with some initiliazed fields (other than Id)?

I want to create an object proxy, similar to what ISession.Load is returning, but with some fields initialized. For other properties, when accessed, the proxy will fetch the entire object from database. Consider the following example: public class…
Vasea
  • 5,043
  • 2
  • 26
  • 30
3
votes
1 answer

Django 1.10 - makemigrations command not detecting changes for unmanaged models

Thanks in advance for your help. Inside mi project I have an app involving models that were generated from an existing database. As those tables are administered by a DBA, they are kept as unmanaged models. As it is possible that we require to…
gaboroncancio
  • 870
  • 1
  • 7
  • 19
3
votes
1 answer

How does EF Generate Proxy classes

I'm toying with building a workflow engine to wrap up my service layer and would like to explore the approach that EF takes to generate transparent proxy classes but I can't seem to figure out from the code on GitHub / CodePlex how it actually…
War
  • 8,539
  • 4
  • 46
  • 98
3
votes
2 answers

Force all nhibernate proxies to be load for an instance

I want to take a snapshot of an instance of an entity and therefore I want to force all proxies to load for this instance. I don't want to disable lazy loading for the majority of the time I just wondering if there is an API I can call to force all…
AwkwardCoder
  • 24,893
  • 27
  • 82
  • 152
3
votes
1 answer

Error accessing a WCF service from a client

I have created a simple WCF service that adds two integers. The service host started perfectly. But on the client-side, I am getting the following compilation error in Reference.cs: The type name 'ServiceReference1' does not exist in the type …
Mangrio
  • 1,000
  • 19
  • 41
3
votes
6 answers

How can I add similar functionality to a number of methods in java?

I have a lot of methods for logging, like logSomeAction, logAnotherAction etc. Now I want all these methods make a small pause after printing messages (Thread.sleep). If I do it manually, I would do something like this: //before: public static void…
Roman
  • 64,384
  • 92
  • 238
  • 332
3
votes
1 answer

dart: proxy annotation usage

Documentation for the @proxy annotation states: If a class is annotated with @proxy, or it implements any class that is annotated, then the class is considered to implement any interface and any member with regard to static type analysis. As such,…
DomJack
  • 4,098
  • 1
  • 17
  • 32
3
votes
2 answers

Programmatically implementing an interface that combines some instances of the same interface in various specified ways

What is the best way to implement an interface that combines some instances of the same interface in various specified ways? I need to do this for multiple interfaces and I want to minimize the boilerplate and still achieve good efficiency, because…
namin
  • 37,139
  • 8
  • 58
  • 74