proxy-classes

After calling NHibernate.Initialize(proxyObject) I'm getting wrong objectType

Hi all. I have object hierarchy Parent->Child (Lazy loading is set to true by default) Now I'm loading all Parent objects from database. All child object will have the type ChildProxyGUID. then I write the IList<Parent> parentList = NHibernateHelper.List<Parent>(); foreach(Parent parent in parentList) { if(!NHibernateUtil.IsInitiali...

Hide to the rest of the world some methods used only by internal classes

Short question I have one C++ domain model. It has some methods used by the internal API as well as other public methods. I don't want to expose those API methods. I'm thinking of using the proxy pattern to hide those methods. Do you think this is a good idea? Is there some design pattern to achieve this? Long example Let's say there'...

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 like: public IBusiness GetBusinessObject() { if (_mode = "remote") return new Busine...

Proxy Objects with ActiveRecord models - method_missing not working sometimes

Hello all! 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 => :destroy [...] def initialize(opts = {}) super(opts) self.box_behavi...