Welcome Gáspár Nagy gn@techtalk.at
Die Top 3 von Visual Studio 2010 und.net 4.0 DEVELOPER UPDATE Projektmanagement Anforderungsanalyse Entwicklung Qualitätsmanagement Usability
About the presenter TechTalk is a software development and consulting company with ~60 people located in Vienna, Budapest and Zürich. Gáspár Nagy At TechTalk since 2001, currently as Leading Software Architect & Development Core Competency Lead gaspar.nagy@techtalk.at http://gasparnagy.blogspot.com Twitter: @gasparnagy Projektmanagement Anforderungsanalyse Entwicklung Qualitätsmanagement Usability
Development Core Competency Represents the expertise of TechTalk in software development and technology Classical focus area of TechTalk from the beginning ~40 developers ~80% of the turnover is related to development Projektmanagement Anforderungsanalyse Entwicklung Qualitätsmanagement Usability
Development Core Competency Competency leads: Christoph Seufert & Gaspar Nagy Competency responsibilities: Coordinate technology updates & research Improve methods & practices Ensure quality Projektmanagement Anforderungsanalyse Entwicklung Qualitätsmanagement Usability
Visual Studio 2010 &.NET 4.0 Big milestone in the.net development Visual Studio 2010 provides better integration to the latest technologies (WPF or SharePoint) and to the latest methodologies (Scrum).NET 4.0 a new runtime and new set of libraries.net 2.0 was released in 2005 Projektmanagement Anforderungsanalyse Entwicklung Qualitätsmanagement Usability
VISUAL STUDIO 2010 Projektmanagement Anforderungsanalyse Entwicklung Qualitätsmanagement Usability
Visual Studio 2010 Projektmanagement Anforderungsanalyse Entwicklung Qualitätsmanagement Usability
Architecture Explorer Visualization is for discovery Code is for delivery - Sebastian Lambla (OpenRasta, OpenWrap) Projektmanagement Anforderungsanalyse Entwicklung Qualitätsmanagement Usability
Architecture Explorer Projektmanagement Anforderungsanalyse Entwicklung Qualitätsmanagement Usability
IntelliTrace Historical Debugging Collects traces of application Allows going back in time Projektmanagement Anforderungsanalyse Entwicklung Qualitätsmanagement Usability
web.config Transformations Projektmanagement Anforderungsanalyse Entwicklung Qualitätsmanagement Usability
.NET FRAMEWORK 4.0 Projektmanagement Anforderungsanalyse Entwicklung Qualitätsmanagement Usability
.NET Framework.NET 4.0 = new framework + new CLR! Not like.net 2.0-3.5, that has used CLR 2 Old app will not run automatically on.net4 But can be enforced with <supportedruntime>.net4 applications can load old.net assemblies as well Directly (.NET4 interprets old assemblies) In-Process Side-by-Side Execution (multiple CLRs can be hosted in a process).net 4.0 Client Profile Limited.NET framework to provide smaller footprint for desktop applications Not included: ASP.NET, Oracle, advanced WCF Projektmanagement Anforderungsanalyse Entwicklung Qualitätsmanagement Usability
.NET Framework Compatibility Typical compatibility scenarios MyApp.exe MyLib.dll Result.NET 4.0.NET 4.0.NET 4.0.NET 3.5.NET 4.0.NET 3.5 (inproc side-by-side).net 3.5.NET 4.0.NET 3.5 + <supportedruntime>.net 4.0.NET 4.0 Client Profile.NET 4.0, using System.Web Projektmanagement Anforderungsanalyse Entwicklung Qualitätsmanagement Usability
What s new in C# 4.0 Office/COM Aim: improve Office/COM access that was traditionally hard to maintain and error prone Problem ((Excel.Range)workSheet.Columns[1]).AutoFit(); Improvement Untyped interface (cast) wordapp.selection.pastespecial( Dynamic ref usedefaultvalue, ref link, Methods with many parameter ref usedefaultvalue, Named and optional ref displayasicon, arguments ref usedefaultvalue, void MyMethod(int ref usedefaultvalue, required, ref usedefaultvalue); string optstr = "default") MyMethod(3, optstr: foo ); excelapp.get_range("a1", Type.Missing); Indexer methods (get_x) Indexed properties excelapp.range["a1"]; Compatibility (Office 2007 app does not work with Office 2010) Type Equivalence Support + Embedding Types from Managed Assemblies Instead of a strong reference the compiler can embed dynamic wrapper types The app depends on the used interfaces only
C# Optional Parameters class DataDomainSchema { class public DataDomainSchema TranslatedType GetType(string name) { { public return TranslatedType GetType(name, GetType(string false); name, } bool thrownonerror = false) {... } } public TranslatedType GetType(string name, bool thrownonerror) //call {... } } schema.gettype( MyClass ); schema.gettype( MyClass, true); //call schema.gettype( MyClass, thrownonerror: true); schema.gettype( MyClass ); schema.gettype( MyClass, true); Projektmanagement Anforderungsanalyse Entwicklung Qualitätsmanagement Usability
C# Optional Parameters class LocalContext { class LocalContext { static public Context Create() {... }... static public Context Create( static IContext public basecontext Create( = null, IContext LockingSemanticsBindings basecontext, lockingsemantics = null, LockingSemanticsBindings CacheConfiguration cacheconfiguration lockingsemantics, = null, CacheConfiguration DataRetrievalConfiguration cacheconfiguration, dataretrievalconfiguration = null, DataRetrievalConfiguration CommitArgs defaultcommitargs dataretrievalconfiguration, = null) {... CommitArgs } defaultcommitargs) } {... } } //call //call LocalContext.Create(); LocalContext.Create();...... LocalContext.Create(dataRetrievalConfiguration: drc); LocalContext.Create(null, null, null, drc); Projektmanagement Anforderungsanalyse Entwicklung Qualitätsmanagement Usability
WF 4.0 Projektmanagement Anforderungsanalyse Entwicklung Qualitätsmanagement Usability
Embedded Process Engine Hosting the execution runtime was problematic in WF3 Now we have three options for execution: WorkflowInvoker to execute a workflow synchronously (like a method) WorkflowApplication to execute workflow(s) with rich (notifications, bookmarks, persistence), event-based functions WorkflowServiceHost stand alone execution environment for workflow instances Improved control of persistence Done automatically (as before) Can be requested explicitly (from code or activity) Improved traceability Monitoring data can be collected through tracking profiles Provided: Event Tracing for Windows (ETW) tracking participant Improved scalability & recovery from failure Projektmanagement Anforderungsanalyse Entwicklung Qualitätsmanagement Usability
WorkflowInvoker Foo Source: PDC09, Matt Winkler
WorkflowApplication Foo Foo Foo Source: PDC09, Matt Winkler
WorkflowServiceHost Foo Foo Foo Source: PDC09, Matt Winkler
Activities in WF Activities can be freely composed workflow is the root activity No need for upfront decision, like in WF3 (sequential/state) Activities can be defined in code or in designer (xaml) Custom activities became first class citizens They are representing the business logic Four possibilities to write custom activity CodeActivity activity with an execute method AsyncCodeActivity for blocking operations NativeActivity for deep integration with host DynamicActivity for runtime creation Existing activities can be customized with activity actions Source: PDC09, Matt Winkler
Built-In Activity Library Rich built-in library to target different problem domains Collection handling (Add, Remove, etc.) Error Handling (TryCatch) Transaction (TransactionScope, Compensate, Confirm, etc.) Messaging (Send, Receive, etc.) Flow Control (Sequence, If, ForEach, etc.) Flowchart Activity 1 Parallel Activity 1 PickBranch PickBranch PickBranch C Activity 2 Approve Action A Reject Action B Delay (TimeOut) Action C Activity 3 Activity 4 Source: PDC09, Matt Winkler
ASP.NET MVC 2.0 Projektmanagement Anforderungsanalyse Entwicklung Qualitätsmanagement Usability
ASP.NET MVC 1.0 Enables you to build applications that can be maintained over the long term: Supports a clear separation of concerns Supports testability Supports close to the metal programming experience Controller View Model Projektmanagement Anforderungsanalyse Entwicklung Qualitätsmanagement Usability Source: PDC09, Stephen Walther
What s New in MVC 2? Better Separation of Concerns (Maintainability) Html.RenderAction() Areas Easier Validation (Maintainability/Productivity) Data Annotations Client Validation Helper Improvements (Maintainability/Productivity) Strongly-Typed Helpers Templated Helpers MVC 2 is built against.net 3.5 VS2010 included (RC includes MVC2 RC) VS2008 downloadable Source: PDC09, Stephen Walther
MVC2 RenderAction
MVC2 RenderAction template template template template Html.RenderPatrial( ) logic
MVC2 RenderAction Html.RenderAction( ) template template template component component component logic component logic logic logic logic
MVC2 RenderAction <% Html.RenderAction() %> For composability and maintanability Menus Banner Ads Shopping Carts Any UI that appears in multiple pages and requires business logic Difference from RenderPartial RenderPartial: Renders UI RenderAction: Invokes controller action that renders UI Source: PDC09, Stephen Walther
MVC2 Areas Enables you to maintain a clear separation of functionality in a single project E.g. admin area, forums area Different sub-sites (folders) inside your project with Own model-view-controller structure Own routing Main application can merge the routings of areas into the main application AreaRegistration.RegisterAllAreas(); Qualified names might need to be used Good tool support in VS ( add new area )
MVC2 Strongly-Typed Helpers Aim: better refactoring support through usage of lambdas instead of strings Html.TextBoxFor() Html.TextAreaFor() Html.ValidationMessageFor() Source: http://bit.ly/8zueom, ScottGu s Blog
MVC2 Templated Helpers (scaffolding) Display Helper Methods Html.DisplayFor() Other oveloads: Html.Display(), Html.DisplayForModel() Edit Helper Methods Html.EditorFor() + overloads Assign display/edit template for properties By type: DateTime.ascx By name: Html.DisplayForModel( MyTemplate.ascx ); By UI hint [UIHint("MyPropertyTemplate")] public string Title { get; set; } Fallback logic for base type The global default lists all properties somehow Can be changed by defining a template for object
Thank you! Gaspar Nagy