Hello Everyone,

           We've been playing with something called Policy-based Design
Pattern ( http://www.freakycpp.com/ ) in C++, that may help with what
you are trying to do.  Because the limitation of Generic vs C++
templates, what we are doing is kind of a Hybrid of this Pattern.
Similar Patterns are (Proxy - boxing, Composite, etc...)  Similar to the
new Nullable object type and EntityRef in .NET 3.0/NHibernate.

Example: 

PolicyContainer<EmptyStringIsNull> _myName = new
PolicyContainer<EmptyStringIsNull>();

// taken advantage of the new .NET 2.0 implicit operator overload
_myName = "Tom";

Assert.True(_myName.Value, "Tom");

_myName = "";

Assert.True(_myName.Value, null);

See Attachments or view the implementation cs files from here: 
http://www.noogen.org/share/ibatisnet/

Regards,

Tom Nguyen 
Sr. Developer
[EMAIL PROTECTED] <mailto:[EMAIL PROTECTED]> 
Rels Valuation

 


************************************************************************************
This e-mail message and any files transmitted herewith, are intended solely for 
the
use of the individual(s) addressed and may contain confidential, proprietary or 
privileged information.  If you are not the addressee indicated in this message 
(or responsible for delivery of this message to such person) you may not 
review, 
use, disclose or distribute this message or any files transmitted herewith.  If 
you 
receive this message in error, please contact the sender by reply e-mail and 
delete
this message and all copies of it from your system.
************************************************************************************

Attachment: PolicyContainer.cs
Description: PolicyContainer.cs

Attachment: DefaultPolicy.cs
Description: DefaultPolicy.cs

Attachment: EmptyStringIsNull.cs
Description: EmptyStringIsNull.cs

Attachment: Singleton.cs
Description: Singleton.cs

Reply via email to