Lugwig,
I've been converting my 1.1 demo
(
http://spaces.msn.com/sholliday/ 5/24/2006 )
I've been using your article/pdf ... and its been very easy with your
examples.
...
For feedback:
Anal Improvement #1
If there was a table of contents with clickable links to stuff like
"Filters", etc, that'd be nice. I did the conversion over a period of 3
days, and I was always text searching to find the right section.
......
Enhanced .Remove method??
Technically, there is one thing I'm trying to do.. and maybe you have
feedback.
The "built in" .Remove method takes an object as the parameter. and returns
a bool ...
Ex:
List<BusinessLayer.BusinessObjects.Customer> custCollection =
GetCollection();//something to get a collection of Customer objects
BusinessLayer.BusinessObjects.Customer custToRemove = custCollection[3]; //
assume 3 or more items in the collection for this illustration
bool itWorked = custCollection.Remove(custToRemove);
Where the .Remove returns a bool .. and the argument a Customer object.
In my 1.1 code .. my .Remove method
#1 I have on .Remove which takes the unique identifier of a Customer
(CustomerId) and then
#2 Uses it to find the Customer object ... then after if finds it... removes
it.
#3 ~~and returns the Customer object back to the caller.
On #3, you'll see that my comments point to the java way of doing a .Remove
........
Not that I'm a super-java lover, but I see the value of doing this
sometimes.
Most times , I don't care about it being removed. On occasion, I may want
to keep track of it .. after I removed it from the Collection.
//Sample Code
public BusinessObjects.Customer Contains( string custId )
{
foreach( BusinessObjects.Customer item in base.InnerList )
if( item.CustomerID .Equals(custId) )
{
return item;
}
return null;
}
public BusinessObjects.Customer Remove(string custId)
{
// see
http://java.sun.com/j2se/1.4.2/docs/...va.lang.Object)
// for java method, which returns the object you removed, in case
// you want to do something with it
BusinessObjects.Customer returnObject = null;
returnObject = this.Contains(custId);
if (null != returnObject )
{
base.InnerList.Remove (returnObject);
}
return returnObject;
}
I guess I'm wondering if there is a way to return the actual Customer object
(that I just removed) back to the caller...
in the Generics world.
I'm working on it now .. to see what I can come up with, but thought I'd
share that nugget with you.
Feel free to comment/critique my method ... you're not going to hurt my
feelings ....
...
Other than that, its been a direct portover.... and I'm becoming more
comfortable with generics, so thanks again for the well laid out article.
...
Sloan
"Ludwig" <no**@none.com> wrote in message
news:vb********************************@4ax.com...
On Thu, 25 May 2006 12:33:46 GMT, Sericinus hunter <se*****@flash.net>
wrote:
I agree. Besides, it took me couple of seconds to visualize
the button, I even almost gave up and noticed it at the very
last moment before going out of the page.
Thanks for the feedback. Meanwhile I've created a html version of the
article.
Other feedback I got:
- generics are not only used for collections
- add generics and databinding topic
I'll update the article in a few days with these additions.
--
Ludwig Stuyck
http://www.coders-lab.be