Presentation Layer – Best Practices – Understand the UI Requirements

Presentation Layer Design Principles : Understand the UI Requirements

Understanding UI requirements is the key for making decisions on the UI type, and the technology and type of controls used to implement it. Your UI requirements are driven by the functionality to be supported by the application and by user expectations.
Start by identifying the users of application, and understanding the goals and tasks these users wish to accomplish when using the application. Pay particular attention to the sequencing of tasks or operations; and determine whether the user expects a structured step-by-step user experience, or an ad-hoc unstructured experience where they can initiate multiple tasks simultaneously. As part of this process, also determine the information required by the user and the format in which it is expected. You may decide to conduct a field study to help you understand the environment in which the user will interact with the application. In addition, consider the current levels of user experience, and compare this to the user experience required for your UI to ensure that it is logical and intuitive. These factors will help you to create a user centered design.

One factor that has a large impact on your choice of technology is the functionality required in the UI. Identify if the UI must expose rich functionality or user interaction, must be highly responsive, or requires graphical or animation support. Also consider the data types, formats and presentation formatting requirements for data such as dates, times, and currency from a localization perspective. In addition, identify the personalization requirements of the application, such as allowing the user to change the layout or styles at run time.

To make the UI intuitive and easy to use, consider how you will lay out or compose the interface; and how the user will navigate through the application’s UI. This will help you to choose the appropriate controls and UI technologies. Understand the physical display requirements (such as screen size and resolution) that you must support, and determine accessibility requirements (such as large text or buttons, ink input, or other specialized features). Decide how you will group related information within sections of the UI, avoid interface conflicts or ambiguity, and emphasize the important elements. Identify ways to allow users to find information quickly and easily in the application through the use of navigational controls, search functions, clearly labeled sections, site maps, and other features as appropriate.

Extension Methods in C#

What are extension methods?

Extension methods in C# are used to extend the functionality of a class which is not provided by the class itself, without altering the definition of the original type. An extension method is a static method of a static class, where the this modifier is applied to the first parameter. The type of the first parameter will be the type that is extended.

Rules to Use Extension Methods

We need to import the namespace in which the static class is defined which contains the extension methods. Suppose I have defined my method in a class which is again defined under namespace. In that case, we need to include the namespace using the keyword using wherever we want to use the method.
C# only supports extension methods, it does not support extension properties, extension events, extension operators.
Extension methods must be declared in non-generic and static classes.
C# compiler looks only for the extension methods defined in static classes that are themselves defined at the file scope. In other words, if we define a static class in some class and then define our extension methods, in that case, we will get a compile time error as shown below.

Copyright © All Rights Reserved - C# Learners