This document discusses developing Windows and web applications using Visual Studio .NET. It covers topics like C# versions, LINQ, data access with LINQ, user experience best practices, Windows Forms capabilities and demos. The agenda includes sessions on business applications, user experience, who applications need to please, and Windows Forms best practices. It also discusses prototypes, choosing between rich client and browser-based solutions, and testing.
10. Enter data Find data Show data Every business app does
11. Professional Feel Enter data Validation Find data Filter data Rich data query Show data Different Views Reports (nice printing) Authorization? Every business app
18. Developers Need a UI to test their software as they build UI increases in complexity as software is built Application grows but the UI isn’t consistent Know how the controls work (or they should!!) Designers May design the UI but not realize WHAT is possible May understand a Visual Consistency but not how its built Who designs the UI?
22. Bandwidth – Presentation layer Cache / persistent state Faster Server Because of less requests and less work… thanks to processing power being used on client Richer interface No buggy DHTML/JavaScript More responsive Faster to develop No cross-browser issues Build complex controls quickly Why Windows Forms?
23. Not allowed in Standard Operating Environment Cross-platform requirements (Linux, PC, Mac) Deployment of the Application is harder / Centralised logic Requires an always-connected data service Why NOT Windows Forms?
24. Network Admins Developers End Users Accounts Who Do I Please? Browser Based Solution Rich Client Solution
26. Avoid the thought of a “throw away” prototype. Use as the first step to start a project (or get a project) - WYSIWYG Get great initial feedback Better than 100 page document Get designer involved if need be (Developers can’t design) Tip: Always add client logo + colours. They are easily impressed! Designing a Mockup UI
27. Would you design Database first or UI? Database schema should be designed before the UI is started If you are doing fixed price work, signed-off mockups serve as a great way to stop goal posts moving. Any changes to the mockups thereafter will result in additional work. Designing a Mockup UI
29. Visual Inheritance Composition and Containment (Panels, Usercontrols) Databinding ToolTips Error Provider and Validators Appsettings Winform Architecture
30. The constructor of each form/control class contains a call of a private method "InitializeComponent()". If B is derived from A, then the constructor of A is called first A() A.InitializedComponent() B() B.InitialzeComponent() Visual Inheritance
31. Controls on the Base Form are BY DEFAULT “private” and cannot be edited in the inherited form Solution: Change the modifer to “Protected” Visual Inheritance
32. Common Behaviour Company Icon Remembering its size and location Adding itself to a global forms collection (to find forms that are already open, or to close all open forms) ** Application.OpenForms Logging usage frequency and performance of forms (load time) No Controls! Inherited Forms – For Every Form
33. CenterParent only for modal dialogs (to prevent multi-monitor confusion) CenterScreen only for the main form (MainForm), or a splash screen WindowsDefaultLocation for everything else (99% of forms) - prevents windows from appearing on top of one another StartPosition
34. FixedDialog only for modal dialog boxes FixedSingle only for the the main form (MainForm) - FixedSingle has an icon whereas FixedDialog doesn't None for splash screen Sizable for any form that has multi-line textbox, grid, listbox or such FormBorderStyle
38. Developers fiddle! Browsable: whether a property or event should be displayed in a Properties window. http://msdn.microsoft.com/en-us/library/system.componentmodel.browsableattribute.aspx EditorBrowsable: whether a property or method is viewable in an editor.http://msdn.microsoft.com/en-us/library/system.componentmodel.editorbrowsableattribute.aspx Hiding Values
39. Hiding Values using System.ComponentModel; [Browsable(false), EditorBrowsable(false)] public new Font Font { get { return base.Font; } set { base.Font = value; } } Imports System.ComponentModel<Browsable(False), EditorBrowsable(false)> _ Public Shadows Property Font() As Font Get Return MyBase.Font End Get Set(ByVal Value As Font) 'MyBase.Font = Value 'normal property syntaxMyBase.Font = New Font(Me.Font.FontFamily, 20) End SetEnd Property
41. You lose the AcceptButton and CancelButton properties from the Designer e.g. OK, Cancel, Apply Therefore the OK, Cancel and Apply buttons cannot be on User Controls. User Controls
42. You can use a user control more than once on the same form e.g. Mailing Address, Billing Address You can reuse logic in the code behind the controls e.g. Search control User controls are less prone to visual inheritance errors User Controls
46. Possible Exception: When a form has multiple tabs, and each tab has numerous controls – it can be easier to use User Control in this case Smaller designer generated code More than one person can be working on a different ‘tab’ User Controls – TabPages
47. Code intensive Must manually handle the Validating event of each control you want to validate Must be manually running the validation methods when the OK or Apply button is clicked Error Provider
51. Validation logic is in the Model Validation with Entity Framework public partial class Employee { partial void OnLastNameChanging(string value) { if (string.Compare(value, "Gfader", StringComparison.InvariantCultureIgnoreCase) == 0) { throw new ArgumentException("No GFADER allowed"); } } }
52. Validation logic is in the Model Validation with Entity Framework publicpartialclass Employee { partialvoidOnLastNameChanging(string value) { if (string.Compare(value, "Gfader", StringComparison.InvariantCultureIgnoreCase) == 0) { thrownewArgumentException("No GFADERallowed"); } } }
56. Happens in model Different UI layers can react to validation differently Web page Windows Form Silverlight WPF ... Validation
57. Monitor Performance better Good user feedback Easy to do AdamE thinks“general user’s don’t care about technical details, a progress bar is better” Do you use a status bar to show load time?
58. Don't use splash screens for branding. Avoid using splash screens because they may cause users to associate your program with poor performance. Use them only to give feedback and reduce the perception of time for programs that have unusually long load times. Don't use animated splash screens. Users often assume that the animated splash screen is the reason for a long load time. Too often, that assumption is correct. Splash Screens
59. Two-way binding means that the object/data structure is bound to the UI Element/Control The setting/getting and the positioning of elements in a collection is handled by the databindingmechansisms Databinding is VASTLY superior in WPF Do you always use the Visual Studio designer for data binding where possible?
60. Bad – write your own boring code Private Sub OnLoad() OrderDetailsService.Instance.GetAll(Me.OrderDetailsDataSet1) Dim row As OrderDetailsDataSet.OrderDetailsRow = Me.OrderDetailsDataSet1.OrderDetails(0) Me.TextBox1.Text = row.UnitPrice.ToString("c") End Sub Private Sub Save() Dim row As OrderDetailsDataSet.OrderDetailsRow = Me.OrderDetailsDataSet1.OrderDetails(0) row.UnitPrice = Decimal.Parse(Me.TextBox1.Text, System.Globalization.NumberStyles.Currency) End Sub
61. Using the Designer SimpleBinding to a single property ComplexBinding to a list
74. Automated recording IntelliTrace (drill through to Visual Studio) Bug in TFS Video.wmv Detailed steps Lots of details (you don’t need if you get intelliTrace) Stack trace System info Microsoft Test Manager
75.
76. Book "User Interface Design for Programmers“ Blog http://www.joelonsoftware.com/ UX patterns http://quince.infragistics.com/ Resources
78. Covers Windows UI reference guidelines This should be your main ‘Bible’ when designing Windows Forms (not Web) if you’re not a designer as it provides a consistent standard Windows UX Guidelines
80. Thank You! Gateway Court Suite 10 81 - 91 Military Road Neutral Bay, Sydney NSW 2089 AUSTRALIA ABN: 21 069 371 900 Phone: + 61 2 9953 3000 Fax: + 61 2 9953 3105 info@ssw.com.auwww.ssw.com.au
Notas do Editor
Click to add notesPeter Gfader Developing Windows and Web applications
Show View call hierarchy: for finding uncalled methodsCtrl+K, Ctrl+T
Who did the C# tutorial?What is .NET?What is .NET framework?What is the CLR?What is OOP?Classes, Objects, Properties, Events, MethodsEncapsulation, Abstraction, Inheritance, Polymorphism
Browse iPhone apps on the web without iTuneshttp://www.yappler.com/
User Experience consists of usability, look and feelWe want to improve the feel and usability
ease with which people can employ a particular tool or other human-made object in order to achieve a particular goal
Make the site feel alive
How can we make our users happy
What do they do?
Its all about the user!
Demo Test managerRecord interaction with NorthwindEntities (from lab week2)