IT Community - Software Programming, Web Development and Technical Support

Proxy objects

This is a discussion on Proxy objects within the C and C++ Programming forums, part of the Software Development category; Proxy objects Objects that stand for other objects are called proxy objects or surrogates. Example: template<class T> ...


Go Back   IT Community - Software Programming, Web Development and Technical Support > Software Development > C and C++ Programming

Register FAQ Members List Calendar Mark Forums Read
  #1 (permalink)  
Old 09-21-2007, 03:39 AM
vijayanand vijayanand is offline
D-Web Analyst
 
Join Date: Feb 2007
Posts: 293
vijayanand is on a distinguished road
Default Proxy objects

Proxy objects

Objects that stand for other objects are called proxy objects or surrogates.
Example:
template<class T>
class Array2D
{
public:
class Array1D
{
public:
T& operator[] (int index);
const T& operator[] (int index) const;
...
};
Array1D operator[] (int index);
const Array1D operator[] (int index) const;
...
};

The following then becomes legal:
Array2D<float>data(10,20);
........
cout<<data[3][6]; // fine

Here data[3] yields an Array1D object and the operator [] invocation on that object yields the float in position(3,6) of the original two dimensional array. Clients of the Array2D class need not be aware of the presence of the Array1D class. Objects of this latter class stand for one-dimensional array objects that, conceptually, do not exist for clients of Array2D. Such clients program as if they were using real, live, two-dimensional arrays. Each Array1D object stands for a one-dimensional array that is absent from a conceptual model used by the clients of Array2D. In the above example, Array1D is a proxy class. Its instances stand for one-dimensional arrays that, conceptually, do not exist.
__________________

J.Vijayanand
Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Sponsored Links
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Proxy objects vijayanand C and C++ Programming 0 09-22-2007 03:19 AM
I get the error "The page cannot be displayed" and an HTTP 502 Proxy Error. Why? kingmaker ASP and ASP.NET Programming 1 07-20-2007 04:43 AM
How many objects are there? vadivelanvaidyanathan Java Programming 3 07-16-2007 10:49 PM
Proxy vadivelanvaidyanathan Server Management 0 07-15-2007 06:34 PM
the new Net Objects 10 aquariancore Web Design Help 1 04-20-2007 08:46 PM


All times are GMT -7. The time now is 11:00 AM.


Copyright ©2004 - 2007, DiscussWeb. All Rights Reserved.

SEO by vBSEO 3.0.0