Carregar apresentação
A apresentação está carregando. Por favor, espere
PublicouIgor de Almeida Castilhos Alterado mais de 8 anos atrás
1
Grupo de Estudos.Net Generics
2
Grupo de Estudos.Net OverView New Feature do.Net Framework 2.0 Conceito de tipo parametro Definir classe e métodos Generalização Reusabilidade Notará que toda referência para object é substituída pelo parâmetro genérico “T” Permite escrever códigos robustos e type safety Performance
3
Grupo de Estudos.Net Generics na prática In Practice
4
Grupo de Estudos.Net Benefits Generalização não mais feita para object Alternativa ao ArrayList (store reference and Value Type) Classe genérica, você pode criar uma coleção que é do tipo segura, em tempo de compilação.
5
Grupo de Estudos.Net Constraints Restringe o tipo parâmetro where T: struct [The type argument must be a value type] where T: class [The type argument must be a reference type] where T: new() [The type argument must have a public parameterless constructor.]
6
Grupo de Estudos.Net Constraints where T : [The type argument must be or derive from the specified base class.] where T : [The type argument must be or implement the specified interface. Multiple interface constraints can be specified.] where T : U [The type argument supplied for T must be or derive from the argument supplied for U.]
7
Grupo de Estudos.Net Links Constraints on Type Parameters (C# Programming Guide) Generic Methods (C# Programming Guide) Constraints on Type Parameters (C# Programming Guide) Collections Best Practice Conversão boxing e conversão unboxing
Apresentações semelhantes
© 2024 SlidePlayer.com.br Inc.
All rights reserved.