About OWIN

Web is evolving fast and web development needs to keep up with it.
One solution is to have an abstraction between the web appplication and the web server.
OWIN (Open Web Server Interface for .NET) – standard interface between .NET web servers and web applications. It decouples server and application. There is no code for OWIN, there are only just specicifications for the real implementation of a custom web server.

OWIN defines a standard interface for web servers and .NET client applications and Katana and Nowin are some implementations.
OWIN runs on the server, answers to HTTP requests, and forwards them to its middleware.

IIS – a super-tested web server but its biggest limitation is that it is related to the OS.

OWIN is not related to the OS, you can build your custom host and add whatever you want in the HTTP request processing pipeline.
The OWIN specs define four layers:
Host: where the server is launched and startup
Server: This is the actual HTTP server, the one binding to the network socket to listen to
requests and sending them to the pipeline of OWIN middleware components.
Middleware: components that stand between the server and the final
application code, and handle the requests sent through the OWIN pipeline(a logger or a full web frameworks like
Web API or SignalR). As far as the server is concerned, a middleware component is
anything that implements the application delegate.
Application: the specific application code, possibly built on top of a web
framework.

HTML and Javascript notes

Semantic Markup – text data that is annotated with a special language to offer more sense or meaning to the text.

SGML (Standard Generalized Markup Language) permitted to researchers to format their documents

HTML – an extension of SGML.

Tim Berners-Lee published aWorldWideWeb – a system of hypertext documents viewed by software named browsers in a client-server architecture.

World Wide Web Consortium (W3C)

Web browser – a gateway to the web-application (retrieve and present the content,allow navigating through different web pages)

 

MVC Architecture

Model – the application data and behaviour in terms of its problem domain. It is independent of the UI. (Domain Model – POCO).

View – the HTML markup we want to display to the user.

Controller – it is responsible for handling a HTTP request. It does some things.

Router – selects the right controller. Based on some rules the router knows that a request should be handled by a method of a class (called an action) with the same name as the request. So, an action in a controller is responsable for handling a request.

ASP.NET Core Authorization

Authentication – when you ask someone who they are and you get its identity.

Authorization – decide what identity is able to do.

You can authenticate but you don’t have to authorize.

You can authorize without having any authentication.

Two main HTTP codes in web security:

401 – Unauthorized – You are not authenticated

403 – Forbidden – You are authenticated but you don’t have access

ASP.NET Authorization workshop

 

 

Testing the usability of a website

A member of a web-design team is also a web-user and sometimes it turns out to be very hard to check the personal preferences at the door. Plus, there is also a professional perspective on what constitutes good Web design. Another level of complexity to any discussion of usability issue is given by the necessary promises made for attracting capital.

Avoid religious debate – discussion where people are expressing strongly held personal beliefs about things that can’t be proven. They rarely result in anyone involved changing his or her point of view.

Test and watch people carefully as they try to figure out what you have designed and how to use it.

A focus group is a small group of people talking about things, like their opinions about products, past experiences and reactions to new concepts. A focus group is useful for getting a sampling of users’ feelings and opinions. It is best used in the planning stages of a project. It can help you finding out whether you are building the right product.

Usability tests are about watching one user trying to do something on a website so you can detect and fix things that confuses or frustrate him.  Usability tests should be used through the entire process.

  • watch other people trying to use your site because after you have worked on a site you know too much.
  • test early in the project
  • a small number of users, not necessarily to be in the audience
  • list the three most serious usability problems you noticed
  • decide what to fix – you should always start by fixing the most serious problems first

Do-It yourself usability testing

 

Notes for a clear, simple and consistent navigation of a website

People won’t use your website if they can’t find their way around it. Looking for something on a website and looking for something in the real world is basically the same. When we are exploring the website it feels like moving around in a physical space but the experience is missing many of the cues of rely in a real life. There is no sense of scale, no sense of direction and no sense of location. This way we should always remember to the user the conceptual hierarchy of the website and retrace his steps. So, web navigation had better be good!

The navigation of the website should have two main purposes:

  1. help us find whatever it is we are looking for
  2. tell us where we are

The navigation of the website should also be able to tell us how to use the site.

There is a set of navigation elements that appear on every page of a site, except forms like paying, subscribing, giving feedback.This is called persistent navigation.

The persistent navigation includes elements like:

  • Logo or SiteId – the highest thing in the logical hierarchy of the site.
  • Sections – the top level of the site’s hierarchy
  • Utilites – links to important elements of the site that aren’t really part of the content hierarchy
  • Home button
  • A way to search
  • Design more then two sub-levels of navigation if needed
  • Page names –  not enough to highlight the selected work into the page layout. The name should be prominent.
  • You are here! sign. It needs to stand out and not too-subtle.
  • Breadcrumbs –  useful in large sites with a deep hierarchy

 

How to design for scanning

There are some important things we can do to make sure that the users see and understand as much of what they need to know and of what you want them to know:

  • Conventions. Follow the existing conventions and standardized design patterns
    • Where things should be located on a page (logo and primary navigation example)
    • How things work (common metaphor for similar sites)
    • How things look (standardize appearance for many elements)
  • Create visual hierarchies. The relationships between the things on the pages should be obvious:
    • which things are most important – (the more important something is, the more prominent it is)
    • which things are similar – (things that are related logically should be related visually)
    • which things are part of other things – « nest » things to show what’s part of what.
  • Break pages up into clearly defined areas – it allows users to decide quickly which areas of the page to focus on
  • Make it obvious what is clickable – looking for the next thing to click is what people are doing on the web
  • Eliminate distractions – avoid visual noise like
    • shouting
    • disorganisation
    • clutter – get rid of anything that’s not making a real contribution
  • Format content support scanning – help users to find what they are searching for in your text.
    • use plenty of headings
    • keep paragraphs short
    • use bulleted lists
    • highlight key terms

Be creative as you want but as long you make sure it’s still usable.

Choose clarity over consistency.

Learn more about making content scannable by reading Ginny Redish’s book Letting Go of the Words.

What is JSX (Javascript XML)

JSX is the markup used when building React applications.

JSX is another way to write Javascript, even it looks like HTML. A transpile step was added to transform it in Javascript because browser don’t understand JSX natively. Ultimately, the Javascript code becomes HTML.

It can be mixed with Javascript. Code written within curly braces is interpreted as literal Javascript.

Web usability guidelines

The most important thing if you want to make sure that your application or your site is easy to use is « Don’t make me think« . A Web page should be self-evident, obvious and self-explanatory.

There is a big difference between how we think people use websites and how they actually use them – glancing each new page, scanning some of the text, click on the first link that catches their interest. So, three facts about real-world Web use:

  1. Users don’t read pages, they scan them. They are on a mission, they don’t have to read everything.
  2. They don’t make optimal choices. They choose the first reasonable option. They are usually in a hurry, there is not much of a penalty for guessing wrong and weighing options may not improve the changes.
  3. They don’t figure out how things work. Not for lack of intelligence but for lack of caring. They forge ahead and muddle through.

Basic concepts of React.js

React is a Javascript library for building user interfaces. It is considered the « V » from the MVC pattern.
React was created to solve one problem: building large applications with data that changes over time.
A React application is build in terms of components. Javascript classes are used when declaring React components.
A component must extend the React.Component class and it must have a render method.
The Virtual DOM is an in-memory representation of the real DOM. It is generated by the components before any changes are made to the page. It happens between the render function being called and displaying of elements. . So, there are two steps:

  1. The render method of the component returns some markup but it is not the final HTML yet. It is an in-memory representation.
  2. The HTML is displayed in the browser.

This makes react faster. It is called diffing and it allows React to minimize changes as a result of user actions.

ReactDOM.Render method is called to render components to a web page.