[ 
https://issues.apache.org/jira/browse/IGNITE-2122?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15057897#comment-15057897
 ] 

Pavel Tupitsyn commented on IGNITE-2122:
----------------------------------------

1) What is the advantage?
2) I can easily imagine such situations, moreover, I've been there. You can 
never expect where "enterprisey" code takes you. Good API should accept the 
most general type possible. There is no single reason to restrict user to 
ICollection there. Especially when it is so easy to support on our side.
3) We are talking about read methods. Write methods do not have adders. 

Another example: user may operate on a Person set in his business logic, but 
use PersonDto to write/read them.
{code}
class Department
{
  MyCollection<IPerson> Persons {get;set;}

  void WriteBinary(..)
  {
    writer.WriteCollection(Persons.Select(p => p.ToPersonDto()));
  }

  void ReadBinary(..)
  {
    Persons = reader.ReadCollection(cnt => new MyCollection<IPerson>(cnt), 
(col, dto) => col.Insert(new Person(dto)));
  }
}

{code}

> .NET: Add generic Read/WriteCollection and Read/WriteDictionary methods.
> ------------------------------------------------------------------------
>
>                 Key: IGNITE-2122
>                 URL: https://issues.apache.org/jira/browse/IGNITE-2122
>             Project: Ignite
>          Issue Type: Task
>          Components: general, interop
>    Affects Versions: ignite-1.4
>            Reporter: Vladimir Ozerov
>            Assignee: Vladimir Ozerov
>            Priority: Critical
>             Fix For: 1.5
>
>




--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Reply via email to