Jump to content
Stéphane Wierzbicki

Is there an "easy" way to transfert Tlist<T> object into a Spring4D ITlist<T> ?

Recommended Posts

Hi,

 

I'm heavily working with Aurelius (which I'm really satisfied) that can store objects within TList<T>. 

 

TList<T>  is missing a lot of functionalities that ITlist<T> provide. 

 

Is there a easy way to have referenced TList<T>  object within ITList<T> ? (I can loop through TList<T> but this is not really practical).

 

Thanks

Share this post


Link to post

If you mean accessing the TList<T> as an IList<T> without moving the items from one list to the other - youll need to write an adapter that wraps the TList<T> into an IList<T> - library does not contain one.

If you mean to move the items then you need to loop or use .ToArray on the TList as the IList interface does not offer any overloads accepting a TList<T> or TEnumerable<T> from System.Generics.Collections and that will not change.

Share this post


Link to post
10 hours ago, Stefan Glienke said:

If you mean to move the items then you need to loop or use .ToArray on the TList as the IList interface does not offer any overloads accepting a TList<T> or TEnumerable<T> from System.Generics.Collections and that will not change.

Thanks for your reply. Object's lifetime cycle is actually handle by Aurelius' manager. Object's stored within TList are only queried for additional checks, needs to see TList acting like a cache. 

 

I'll then use .ToArray and then free TList.

 

Ps: @Wagner Landgraf it will be nice allowing TMS Biz products using Spring4D library 😄

 

 

Share this post


Link to post
On 2/27/2021 at 3:39 AM, Stéphane Wierzbicki said:

Thanks for your reply. Object's lifetime cycle is actually handle by Aurelius' manager. Object's stored within TList are only queried for additional checks, needs to see TList acting like a cache. 

 

I'll then use .ToArray and then free TList.

 

Ps: @Wagner Landgraf it will be nice allowing TMS Biz products using Spring4D library 😄

 

 

That's for sure. We could even use more things and types from Spring4D.

The main problem, actually - besides some time to integrate - is the deploy of it. Installation is already complex, it's rather complex to add Spring4D as a dependency, worse, as an optional dependency. That's why I'm really looking forward to @Vincent Parrett's DPM, when it's ready, we could deploy several different packages, and it will just download and install whatever dependencies it needs.

  • Like 2

Share this post


Link to post

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×