Securing .NET Web Application from Common Attacks

nvidia3dvision_1Web Application is so vulnerable to attacks especially if deals with money, sensitive information and/or business trade secrets. This is a big problem in the IT world and big funds are spend just to protect them from these attack.

Tips On Optimizing Frontend Web Application

"80-90%” of the end-user response time is spent on the frontend. Start there. 
-Steve Souders

What are Inversion of Control (IoC), DIP, DI, and IoC Container?

Many developers are confused about DIP, IoC, DI, and IoC Container. Well, we've been using the concept even the from the DOS mode era. It’s only when SOLID OOP Design and Design Patterns were introduced that made this popular. It is the D in the SOLID acronym which stands for Dependency Inversion Principle. New concepts were added of course.

Paging, Sorting, and Searching in ASP.NET MVC using PagedList and Dynamic Linq

PagedList.mvc is a lightweight API for server side paging in ASP.NET MVC. The only thing we want to avoid is reading all the records from the database and let the PagedList display the records by page. Obviously it's a bad design. What we want to achieved is to read and display the records per page.

UX Design Tips: UX Designers and Software Architects Should Know

Rationale

UX Design is one of the most important thing in Software Development today most especially in web applications. And these are the reasons why:

Adapter Design Pattern

A Software Design Pattern that allows the interface of an existing class to be used from another interface. It is often used to make existing classes work with others without modifying their source code.

Unit of Work Design Pattern

Maintains a list of objects affected by a business transaction and coordinates the writing out of changes and the resolution of concurrency problems.

Prototype Design Pattern

Specifying the kinds of objects to create using a prototypical instance, and create new objects by copying this prototype. Instead of using new keyword to create objects, prototype design pattern will just copy the object created. It’s a clone. A photo copier would the best example in the real world that resembles this pattern.

Singleton Design Pattern

In software engineering, the singleton pattern is a design pattern that restricts the instantiation of a class to one object.  This pattern ensures that a class has only one instance and provides a global point of access to it. This is considered of the the simplest  design pattern.

Builder Design Pattern

The purpose of Builder Design Pattern is to separate the construction of complex object from its representation so that the same construction process can create different representation. It is usually use in building complex objects by using a step by step approach.

Abstract Factory Design Pattern

Abstract Factory patterns acts a super-factory which creates other factories. This pattern is also called as Factory of factories. In Abstract Factory pattern an interface is responsible for creating a set of related objects, or dependent objects without specifying their concrete classes.

Strategy Design Pattern

In computer programming, the strategy pattern (also known as the policy pattern) is a software design pattern that enables an algorithm's behavior to be selected at runtime. The strategy pattern
  • defines a family of algorithms,
  • encapsulates each algorithm, and
  • makes the algorithms interchangeable within that family.

Benefits of Removing Unused Using Directives

When you create a new a program, class, or interface (anything that has a code) in Visual Studio, using directives or assemblies are added by default. Visual Studio assumes that you will be needing these directives. But these directives cause some awkward effects on your development when they are not used.

This will accumulate as your codes grow up and unknowingly, it is slowing you down.

Factory Design Pattern

In class-based programming, the factory method pattern is a creational pattern which uses factory methods to deal with the problem of creating objects without specifying the exact class of object that will be created. This is done by creating objects via a factory method, which is either specified in an interface (abstract class) and implemented in implementing classes (concrete classes); or implemented in a base class (optionally as a template method), which can be overridden when inherited in derived classes; rather than by a constructor.


Using LESS CSS To Implement DRY Principle

CSS is painful. Everybody agrees with that. Repeatable colors  and values are everywhere. When you want to change 1 value you need to search and change values that are affecting the style. We could avoid this by using LESS.

Preventing BootStrap Alert From Being Remove on the DOM

BootStrap Alert is used to display messages or error messages on the DOM while users tries to navigate or perform some actions on the web. But by default, the BootStrap Alert is only one time use. The moment the alert was closed, it will never appear again.

Handling Multiple Entries and One Time Post in ASP.NET MVC

Introduction

One type of Data Entry patterns in Web Application is multiple data entry. Examples of these multiple data entry are orders entry, guests registration, etc. In this example we will be using Client Registration. Below is a screenshot on what we will be working.

Creating Live Scoring using SignalR, BootStrap CSS, HMTL5 and jQuery

ASP.NET SignalR is a library for ASP.NET developers that enables real-time communication on the web or desktop. It uses WebSockets of HTML5 API to enable bi-directional communication between the browser and server.

Repository Design Pattern : Implementing Generics, MOQ, MSTEST In ASP.NET MVC

Repository Design Pattern is a way to encapsulate repetitive data access code.

Repository Pattern is effective data access design pattern when we want to:
  • Increase testability of the application. Make test repeatable without touching the data source;
  • Implement Separation of Concerns between the business logic and data source or business logic and test units;
  • Make the application work with different data source such SQL Server, mySQL, Oracle, web api endpoints, xml file and other RDBMS out in the market.
  • Make our code reusable. Effective on CRUD.

Code Review : A Simple Guide

code_review
What is a Code Review?

A.KA. – Code Analysis Review. It is an ongoing process to allow developers to improve code quality.  This is defining moment where they can spot code smells, serious vulnerabilities and be able to  promote readability, maintainability, security, and extensibility of codes or in short-high cohesive and loosely coupled codes.

Asp.Net MVC and CSS : How to keep the footer stay at the bottom without breaking BootStrap features

By default asp.net mvc provides footer but the problem is it does stay at the bottom of the page. There's a solution provided by BootStrap but it is sticky. We want something that is relative to the page.

The solution presented here is compatible in desktop devices as well as mobile devices.

You can download this @ github.com/wcadap

Object Oriented Programming Concepts

OOP OOP is a programming paradigm that represents the concept of "objects" that have data fields (attributes that describe the object) and associated procedures known as methods. Objects, which are usually instances of classes, are used to interact with one another to design applications and computer programs.

Each module is split apart into self-contain objects and each object contains its own data, logic and function. In order for these modules to function as one, they should communicate with each other.

It is problem solving technique that is based on the real world scenario/modeling.

It is a design philosophy that implements modular programming that enables developers to reduce dependencies (tight coupling) and promotes high cohesion(readability, maintainability, reusability, extensibility,  and traceability) that makes more codes manageable.

The problems with traditional programming (Procedural Programming):
  • Too huge to handle.
  • Not ideal for team development.
  • Too difficult to trace and debug.
  • Limited reusability and extensibility.
  • Cascading effect (when editing one module, other modules will be affected) due tightly coupling issue.
  • Too difficult to test.
  • Take longer time to compile therefore slow development.
  • Abstraction is too difficult.
  • And many more...
Can OOP solve these problems?

The answer is yes. Just imagine a car production where the parts are separated from each other and can be connected through knots volts and wire. If one part is defective, it can be easily replace. Easy to diagnose/troubleshoot, upgrade, and extend. This is what i called it real world modeling.

Advantages of OOP for developers:
  • Avoid spaghetti code. Developers spend more time in debugging/tracing than in developing so readability and traceability is very important during debugging.
  • When working as a team, task can be easily separated and integrate.
  • Delivery of upgrades and corrections are easier to ship. Since it is modular, only the affected updates will be ship.
  • Faster compilation and testing. Stable codes needs not be to compile during development.
What builds around OOP?

Objects and Classes

Whenever we build application, we always work on classes and objects. These two are the models of what we are trying to build.
  1. Object
  2. In real word, an object is a thing that has independent identity from one another. It has attributes (color, shape, state) and behaviors (what can they do: fly, walk, talk and etc.) regardless of what families they came from.

    In OOP, we use the concept of a real world object. Objects in OOP have their own identity separate from one another, properties, and behaviors.“In OOP, objects are not always physical and visible items. They are NOUNS or SUBJECTS. Examples of these are events, dates, account and timer.”

    Objects and classes are related to each other and knowing class will brings to a complete understanding of these two.

  3. Class
  4. In order implement reusability and inheritance in OOP, it easier to create a class that represents the properties and behaviors of all objects. So we can create one class and create multiple objects out it.

    “Class is best described as template or blueprint of objects and objects are instance of a class.”

    “Classes are user defined types that can be made up of primitive types or collections of classes”.

    Meaning class is not the real object but it is only a representation of object.

    Essential Components of a Class:
OOP Real WorldExample
Type NameCat
Properties/Data AttributeColor, Height
Methods/ Operations BehaviorRun, Walk


Fundamental Principles of Object Oriented Programming?

In order to achieve object-oriented principle, there are 4 fundamental approach to make classes and objects working together:
  1. Abstraction
  2. “Abstraction (from the Latin abs, meaning away from and here, meaning to draw) is the process of taking away or removing characteristics from something in order to reduce it to a set of essential characteristics.”

    In OOP, it is the process of hiding all but the relevant data about an object in order to reduce complexity and increase efficiency. It focuses on exposing essential/relevant qualities of objects rather than the details. It called the heart of OOP because whenever we create classes we always do abstraction.

  3. Encapsulation
  4. This is were decoupling comes in OOP wherein we want to contain the logic and data within one class so that we can reduce dependencies. If one part of the code was changed, it will not affect the others.

    It is also called "information hiding". An object has to provide its users only with the essential information for manipulation, without the internal details.

    In software development, business logic should not be expose. We should limit the access of vital implementation or formulas in order to protect it from tampering.

  5. Inheritance
  6. This is one of the fundamental principle of OOP. It allows a class to "inherit" (behavior or characteristics) of another, more general class.

    Inheritance is a great form of code reuse where data definition, logic, and validations will be defined in a parent class and can be applied to child classes that inherits them.

  7. Polymorphism
  8. In OOP, objects have the ability to transform in many forms during its implementation.

    The ability of classes to perform different functionalities while sharing the same interfaces.

    Real World Examples:
    1. A person that can speak 2 languages
    2. A BlueRay player than can also play DVD.

    OOP Example:
    Method Overriding, Method Overload, and shadowing

Responsive CSS Flip Animations

One way to add user experience to your website is by adding animation with graceful transition. This article discusses simple responsive flip animation using CSS (no JavaScript) to display the best movies in 2013.