Your SlideShare is downloading. ×
[Run Reloaded] Presentando .NET 4.0 (Diego González + Pablo Zaidenvoren)
Upcoming SlideShare
Loading in...5
×

Thanks for flagging this SlideShare!

Oops! An error has occurred.

×

Saving this for later?

Get the SlideShare app to save on your phone or tablet. Read anywhere, anytime - even offline.

Text the download link to your phone

Standard text messaging rates apply

[Run Reloaded] Presentando .NET 4.0 (Diego González + Pablo Zaidenvoren)

463
views

Published on

[Run Reloaded] Presentando .NET 4.0 (Diego González + Pablo Zaidenvoren)

[Run Reloaded] Presentando .NET 4.0 (Diego González + Pablo Zaidenvoren)


0 Comments
0 Likes
Statistics
Notes
  • Be the first to comment

  • Be the first to like this

No Downloads
Views
Total Views
463
On Slideshare
0
From Embeds
0
Number of Embeds
1
Actions
Shares
0
Downloads
2
Comments
0
Likes
0
Embeds 0
No embeds

Report content
Flagged as inappropriate Flag as inappropriate
Flag as inappropriate

Select your reason for flagging this presentation as inappropriate.

Cancel
No notes for slide

Transcript

  • 1.
  • 2. Presentando .NET 4.0
    Diego
    González
    Pablo
    Zaidenvoren
  • 3. Agenda
    C# 4.0
    Dynamic Language Runtime
    Keyword “dynamic”
    Co y Contra-Varianza
    Code Contracts
    Parametrosopcionales
    Base Class Library
    Task Parallel Library
    Cambios en el IDE
  • 4. Novedades en C# 4.0
  • 5. Dynamic Language Runtime
  • 6. Dinámico vs. Estático
  • 7. Tiposdinámicos
    Ruby
    Python
    Tiposestáticos
    VB
    C#
    Common Language Runtime
    Dynamic Language Runtime
  • 8. Tiposdinámicos
    Ruby
    Python
    Tiposestáticos
    VB
    Dynamic Language Runtime
    C#
    Common Language Runtime
    Dynamic Language Runtime
  • 9. Keyword “dynamic”
  • 10. Keyword dynamic
    Permiteutilizar a estructurasdinámicasdesde C#.
    ClaseDynamicObjectexponecomportamientodinámico.
  • 11. Demo
  • 12. Dynamic Language Runtime
    Un puenteparaoperar con estructurasdinámicas
    Reduce la complejidad de programación
    Facilita la implementación de lenguajesdinámicos
  • 13. Demo DLR
  • 14. Co-varianzayContra-varianzasegura
  • 15. Co- and Contra-varianza
    Los arrays en .NET son co-variantes
    string[] strings = GetStringArray();
    Process(strings);
    …pero no son co-variantes seguros
    void Process(object[] objects) { … }
    voidProcess(object[] objects) {
    objects[0] = "Hello"; // Ok
    objects[1] = newButton(); // Exception!
    }
    Hasta ahora los generics en C# era invariantes
    List<string> strings = GetStringList();
    Process(strings);
    C# 4.0 soporta en forma segura co- and contra-varianza
    voidProcess(IEnumerable<object> objects) { … }
    void Process(IEnumerable<object> objects) {
    // IEnumerable<T> is read-only and
    // therefore safely co-variant
    }
  • 16. publicinterfaceIEnumerable<T>
    {
    IEnumerator<T> GetEnumerator();
    }
    publicinterfaceIEnumerable<out T>
    {
    IEnumerator<T> GetEnumerator();
    }
    Co- and Contra-varianza segura
    out
    publicinterfaceIEnumerator<T>
    {
    T Current { get; }
    boolMoveNext();
    }
    publicinterfaceIEnumerator<out T>
    {
    T Current { get; }
    boolMoveNext();
    }
    IEnumerable<string> strings = GetStrings();
    IEnumerable<object> objects = strings;
    in
    publicinterfaceIComparer<T>
    {
    int Compare(T x, T y);
    }
    publicinterfaceIComparer<in T>
    {
    int Compare(T x, T y);
    }
    IComparer<object> objComp = GetComparer();
    IComparer<string> strComp = objComp;
  • 17. Code Contracts
  • 18. Demo
  • 19. Code Contracts
    Pre-Condiciones
    Post-Condiciones
    Invariantes
  • 20. Parámetros
  • 21. Parámetros opcionales
    Método primario
    publicStreamReaderOpenTextFile(
    stringpath,
    Encodingencoding,
    booldetectEncoding,
    intbufferSize);
    Overloads secundarios
    publicStreamReaderOpenTextFile(
    stringpath,
    Encodingencoding,
    booldetectEncoding);
    publicStreamReaderOpenTextFile(
    stringpath,
    Encodingencoding);
    publicStreamReaderOpenTextFile(
    stringpath);
    Llamada al primario con valores default
  • 22. publicStreamReaderOpenTextFile(
    stringpath,
    Encodingencoding,
    booldetectEncoding,
    intbufferSize);
    publicStreamReader OpenTextFile(
    string path,
    Encoding encoding = null,
    bool detectEncoding = true,
    int bufferSize = 1024);
    Parámetros opcionales
    Parametros opcionales
    Argumentos con nombre
    OpenTextFile("foo.txt", Encoding.UTF8);
    OpenTextFile("foo.txt", Encoding.UTF8, bufferSize: 4096);
    Los argumentos se evaluan en el orden que se escriben
    Los argumentos con nombre pueden ir en cualquier orden
    Los argumentos con nombre deben ir al final
    OpenTextFile(
    bufferSize: 4096,
    path: "foo.txt",
    detectEncoding: false);
    Los que no son opcionales se deben especificar
  • 23. Base Class Library
  • 24. Task Parallel Library
  • 25. Concurrencia
    Programming Models
    Integrated Tooling
    Programming Models
    PLINQ
    Messaging Blocks
    Parallel
    Debugger Tool
    windows
    Parallel Pattern Library
    Task Parallel
    Library
    Agents
    Library
    Data Structures
    Concurrency Runtime
    Concurrency Runtime
    Data Structures
    Task Scheduler
    ThreadPool
    Profiler Concurrency
    Analysis
    Task Scheduler
    Resource Manager
    Resource Manager
    Operating System
    Threads
    Key:
    Managed Library
    Native Library
    Tools
  • 26. Concurrencia
    Task Scheduler
    Coordination Data Structures
    Task Parallel Library
    Parallel LINQ
  • 27. Demo
  • 28. Cambios en IDE
  • 29. Cambios en IDE
    Editor totalmenterenovado
    Diálogo “New Project” mejorado
    Zoom integrado
    “Add Reference” másrápido
    Soportepara F#
    Herramientaspara debug concurrente
  • 30. Cambios IDE
    Call Hierarchy navigation
    Navigate to symbol
    Reference highlight
    Erroressemánticosmejorados
  • 31. Cambios IDE
    Debug concurrente
    Debug histórico
    Análisis de dumps
  • 32. Otrasnovedades
    Side-by-side execution mejorado
    Lazy Initialization
    Másespacio en Isolated Storage
    GC corre en background
    Memory Mapped Files
    PIAsintegradas en otras assemblies
  • 33. ¿Preguntas?