ssteenkiste / nettiers

Automatically exported from code.google.com/p/nettiers
1 stars 0 forks source link

Need operation on TList<T> for "removing" from the list wihtout meaning "move to DeletedItems & Delete on Saving"... #301

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
Far too many developers on my team were burned by this in the past.

They call .Remove on a TList<T> derived list and they think they simply 
removed it from the collection - out of sight / out of mind...

What they don't realize is that it actually moves the Entity into the 
DeletedItems and marks the EntityState as Deleted...

When they subsequently call the Save operation on the service layer and 
pass in this TList<T> derived list - they scratch their heads wondering 
why their data disappeared...

It would seem .Remove should remove from the list and .Delete would do 
what is currently happening... Poor choice of naming IMO... they're 
expecting the standard .NET base-class behavior from the Remove operation -
 but being that changing that now would be too extreme of a breaking 
change... we're stuck with it. But we still need SOMETHING with a clear 
operation name that will simply remove an entity from the list without the 
additional TList<T> specific deletion behavior...

How about a new operation or perhaps at least an override for Remove (i.e. 
add a Bool argument for "MoveToDeletedItems" defaulting to true for 
backwards compatability on the argument-less method signature)...

Original issue reported on code.google.com by bh...@yahoo.com on 27 Apr 2010 at 8:57

GoogleCodeExporter commented 9 years ago
Hello,

We agree that this should be renamed. We will look into the side effects and 
backwards 
compatibility when adding this functionality to .netTiers 3.0.

Thanks
-Blake Niemyjski

Original comment by bniemyjski on 2 Jun 2010 at 3:52

GoogleCodeExporter commented 9 years ago
Follow-up - With 3.0 coming closer to a CTP was a decision made on this?  It 
sounds like 3.0 might have sweeping (possibly breaking) changes as it is - and 
if so I'm hoping the next major version can use Remove to do what is actually 
expected and not catch the developers by surprise when they find their data 
missing!

Original comment by bh...@questis.com on 21 Sep 2010 at 8:38