Home
Help
Register
Log in

Search

 
   Active Threads  

You are here: Home > LLBLGen Pro > LLBLGen Pro Runtime Framework> IPredicateExpression Question
 

Pages: 1
LLBLGen Pro Runtime Framework
IPredicateExpression Question
Page:1/1 

  Print all messages in this thread  
Poster Message
Wade
User



Location:
Shelbyville, KY USA
Joined on:
15-Jun-2004 05:11:01
Posted:
76 posts
# Posted on: 23-Oct-2007 16:20:05.  
I am sure someone on the board can tell a the answer to a most likely easy question. Why in the examples we see posted on the forums and in some of the help does this occur?

IPredicateExpression p = new PredicateExpression();

versus

PredicateExpression p = new PredicateExpression();



What is the difference between the two? Is there a certain set of circumstances to use one over the other?

Thanks,
Wade
Thanks,
Wade
 
Top
Wade
User



Location:
Shelbyville, KY USA
Joined on:
15-Jun-2004 05:11:01
Posted:
76 posts
# Posted on: 23-Oct-2007 21:21:02.  
Frans,

Any chance you can answer this for me?    Confused

Thanks,
Wade


Thanks,
Wade
 
Top
goose
User



Location:
Central America
Joined on:
06-Aug-2007 18:21:05
Posted:
392 posts
# Posted on: 24-Oct-2007 00:18:36.  
I've dive into the source code to find the answer, and I found that the IPredicateExpression interface is implemented only by the PredicateExpression class, so my best guess is that is just good programming practices.

I suppose it was coded that way in case we need another kind of PredicateExpresion class in the future.
gansodesoya  Top
JimHugh
User



Location:
Davis, CA
Joined on:
16-Nov-2005 14:32:25
Posted:
191 posts
# Posted on: 24-Oct-2007 15:07:03.  
By implementing an interface it allows someone else (e.g. you or I) to create our OWN implementation of that interface and use it instead of the vendor supplied implmentation.

Interchangably and without the vendor having to provide additional extensions.

As far the the vendors internal code goes, the vendor may only provide one implementation, but the USAGE in the rest of the vendors code utilizes interface types instead of implementation types. That is what allows us to substitue our own impementation.

So if at all possible, use this format:
Code:

IPredicateExpression p = new PredicateExpression();


That will allow you to change the implementation of IPredicateExpression in one place and all code that knows how to utilize an object that implements the IPredicateExpression interface will continue to work without modification.

So if you created your own, you would change it to:
Code:

IPredicateExpression p = new MyPredicateExpression();



Jim Hughes  Top
Walaa
Support Team



Location:

Joined on:
21-Aug-2005 16:03:48
Posted:
14626 posts
# Posted on: 24-Oct-2007 16:46:15.  
Quote:
What is the difference between the two? Is there a certain set of circumstances to use one over the other?


If you are not going to implement your own PredicateExpression (most users find no need for that), then there is no difference between both ways of coding.
  Top
Pages: 1  


Powered by HnD ©2002-2007 Solutions Design
HnD uses LLBLGen Pro

Version: 2.1.12172008 Final.