Thursday, March 16, 2017

Friday, March 10, 2017

Web Application Development - At DB Side

The third part is data source/base part. The server could have DB within it or could communicate to storage at remote location.

SQL
Structured Query Language is the language to manipulate data with DB and to create/delete tables. It is supported by all RDBMS.

Oracle SQL Server
Software tool provided by Oracle enterprise to manipulate with their DB

Some Relational Data Base System (RDBMS)

  • Oracle - Most widely used DB in all platforms
  • SQL Server - Modern simplified DB from Microsoft 
  • My SQL - Open Source DB used by PHP widely

Entity Framework
Its framework available with Visual Studio to execute DB queries using LINQ. This is wrapper around SQL calls to manipulate data in RDBMS. Also, the same calls could execute on any data source.



Web Application Development - At Server Side

Data from client needs to be transferred to server. Server would manipulate data after querying with DB if required and returns the requested value to client using JSON object format.

From Visual Studio IDE, the ASP.net MVC project has to be built with front end project, server project and DB project if required in one solution. The solution has to be published to server side using ISS at server. Then, server gets all required .DLL for business logic and data access along with HTML views/pages.

When a particular URL is entered by user then using domain name, DNS does name resolution and identify the IP and port number of server and connect to fetch views and data.

C# .NET is commonly used programming language at server side.

Session
When ever we need to store persistent data across multiple pages, we can use session at server side to store the same. When network is gone, we couldn't keep this info at client side.

Quick Snap at MVC
Every URL/path business classes act as controller as per MVC pattern. The controller controls DB data rendering to Views and views data flow to DB. The controller could have multiple views which has to be returned to client at request. The manipulated data and/or user input data get stored in data base/source via controller.  

Web Application Development - At Client Side

Web Application Development is new arena for me. Being a windows native application developer, I got chance to write web app now. These are all some new stuffs in my learning pathway towards web world:
Web applications are segregated/distributed into some layers, say

  1. Client Side 
  2. Server Side
  3. DB Side

1. Client Side
Client side development mainly involves in Graphical User Interface or Web page development. Plethora of tools are used to achieve the purpose.

1.1 HTML / HTML5
Hyper Text Markup Language is introduced to define the content body of information. It uses tages to define various parts of markups. UI controls also could be marked using tags. It doesn't have much intelligence like enhancing asethetics of UI, UI event handlers...etc

1.2 CSS
Cascading Style Sheet is primarily used along with HTML to enhance the UI. It helps to align controls/layout and change background colors...etc

1.3 BootStrap
As CSS users are not having UI standards and writing CSS was little tedious, BootStrap UI framework came to picture which make front end developers life easy by providing HTML and CSS templates and wrapper class libraries.

1.4 Java Script / JQuery / Knockout JS / Angular JS
Ok, which module would take care of event handling at controls/URLs? Java Script is primarily used to handle events and send data to Server side. JQuery is successor of JavaScript. KnockOut is successor of JQuery. Currently, the most advanced version of this arena is take care by Angular JS.

Data which needs peristent storage across various pages of web Apps could use cookies to store them temporarily.


Wednesday, March 1, 2017

Observer Design Pattern

This design pattern is typically used in publisher-subscriber scenario hence it could be implemented easily with events and delegates in C#

The idea is the publisher is event owner. Subscribers are added themselves to publishers for notification. When event occured then publisher notifies about that to every registered subscribers.

Technically, publisher owns the event handler in which list of delegates of subscribers would be called. Subscribers get their event notification through predefined common protocol i.e delegate. Publisher adds list of subscribers in its multi cast delegate. The event args are passed to subscribers through event handler at publisher.

NOTE: We can't let subscriber to take ownership of delegate as they get exposed to all other subscribers and they could modify that which violates encapsulation.

Here is the demo:
https://www.codeproject.com/Tips/769084/Observer-Pattern-Csharp

Learning by Watching! - C# Videos