Posts

Showing posts from August, 2019

Static class in C#

Static Class                            we cannot create an object of that class using the  new  keyword, such that class members can be called  directly using their class name . Created using the  static  keyword. Inside a static class  only static members are allowed , in other words everything inside the static class must be static. We  cannot create an object  of the static class. A Static class cannot be inherited. It allows only a static constructor to be declared. The methods of the static class can be called using the class name without creating the instance.     (e.g) Static class Employee { }

Design principles for Dotnet core

In this section we are going to learn more about the basic design principles for Dotnet core. Developing a clean architecture adhering to the best practices adds several benefits. A few common design principles that should be addressed when designing developing applications in Dotnet core. 1.KISS 2.YAGNI 3.DRY 4.SoC 5.SOLID 6.Caching 7.Data structures 8.Communication 9.Resource management 10.Concurrency 1.KISS(Keep It Simple Stupid)         Writing cleaner code and keeping it simple always helps developers understand and maintain it in the long run. Adding unnecessary complexity in the code makes it less understandable and hard to maintain. KISS principal is used while designing software architecture,using OOP principles, designing the database,user interface and so on. 2.YAGNI(You Aren't Gonna Need It)          YAGNI is one of the core principles of XP(extreme programming). XP is a software methodology. The primary goal is...

Coding Principles in C#

In this section we are going to learn about some of the basic coding Principles that help in writing good quality code that improves the overall performance and scalability of the application. 1. Naming convention   Always use the proper naming convention. *Solution name should provide meaningful information about the project. *Project name should specify the layer or component part of the application. *Solution name should always be different from the project name. Because one solution may contain multiple projects. *Classes should be noun or noun pharses. *Methods should represent the actions. *Pascal casing for Class and method . *Camel casing for parameters and other variables. *In Pascal casing, first letter of every word is capital letter. *  In Camel casing , first letter of every word is small letter . 2.Code Comments  Proper comments assist developers in many ways . It reduces the time to understand the code. So proper Comments should be given. ...

Difference between Overloading and Overriding in C#

Overloading is a concept where we can have same method names with different input signature( Compile Time Polymorphism). In Overriding we have a parent class with virtual functions which are overridden in the child classes( Run time Polymorphism ).

Difference between Abstraction and Encapsulation in C#

Abstraction *Showing only what is necessary *It is done in Design phase. *It can be achieved using Abstract class and interface. Encapsulation *Hiding the unnecessary data. *It's done in Coding phase. *It can be achieved using Access modifiers.

Disadvantages of viewdata and viewbag in Asp.net MVC

*Performance issue- Data inside the viewdata is type of object. So we have to cast the data to correct type. It will affect performance. *We can't get compile time error if we cast to wrong type.

Typescript data types

Typescript is pure object oriented language. The popular JavaScript framework Angular is written in Typescript. Variable declaration is done with the help of the keyword " let " . Boolean let success:boolean=false; Number let age:number=25; let amount:number=12.34; String let name: string=" saravanan"; Concatenation let age:number=25; let name: string="saravanan"; let details: string= name + " age is " + age; Array let amount:number[]=[10,20,30]; Tuple let x:[string, number]; x=["aravind",24]; Enum enum alert {success, failure}; let status:alert=alert.success;

Difference between wcf and Web services

* Wcf services can be hosted in multiple protocols like http,tcp etc. Whereas web services can be hosted only on http protocol. *Two different wcf services can be called in a transaction whereas we can't call two different web services in one transaction .

Difference between stored procedure and function

* CRUD operation can't be done using Function whereas it's possible using Stored procedure. *Function can return only one value whereas Stored procedure can return zero or more values. *Function can have only input parameters whereas Stored procedure can have both input and output parameters. *Stored procedure can't be called from Function whereas Function can be called from Stored procedure.

Characteristics of Microservices

* Small in size * Messaging enabled * Bounded by contexts * Autonomously developed * Independently deployable * Decentralized * Built and released with automated processes.

Advantages of Microservice architecture

* Micro sevices is the process of breaking larger application into loosely coupled modules, which communicates with each other through small APIs. * We can identify the bottlenecks in services and fix them without massive rewrites. * Developers can test services easily because every services would be smaller. *Applications are smaller ,so it will be  deployed quickly. * Services are limited, so it's obvious to monitor each of these instances. *Each services are independent. So if one service fails others will work without any interruptions . * Easy to understand since they serve a small piece of functionality. *Micro services are pure agile and works hand in hand with DevOps . *Smaller code bases make maintenance simpler and faster.

Disadvantages of Monolithic architecture

*The code base grows with in it when application grows. *If any single application or component fails ,then the entire application goes down. *If a single change to the system would require the whole application to be redeployed. *Developers can't work independently to develop or deploy their own modules.

Asp.net MVC

MVC is an architectural pattern. It's divided in to three broad sections. The main benefit of MVC is Separation of Concern (SoC). Through this SOC we can reuse the code to a great extent.We can manage the code efficiently by this architecture. 1.Controller(C) 2.Model(M) 3.View(V) 1.Controller(C)   Controller will handle the user's requests and send the response. Controller is responsible to load the appropriate "Model" and "View" via Action methods. Controllers are the central part of the MVC architecture. Action methods- Action methods are simply a public method inside controller which accepts user's request and returns some response. (e.g) public class TestController: Controller { public string GetString() { return "Everything will be alright"; } } 2.Model(M)   Model provides data to the "View". Model represents "Business data". Data from controller to view will be passed in the form of "Model". ...

Asp.net Web forms

Introduction Asp.net web forms has been serving successful web application development  for last 12 years. It is due to RAD(Rapid Application Development) and visual programming approach. The name of Microsoft's IDE(Integrated Development Environment) is "Visual Studio". In Asp.net web forms default response is always HTML .If we want to return something other than HTML We have to create HTTP handlers, override content type,do Response.End etc. The visual RAD architecture of Microsoft has two components. They are 1.UI- ASPX 2.Code Behind-ASPX.cs Problems in web forms Performance It's the biggest problem in web forms. The main reason for this is, conversion from sever controls to HTML controls. This conversion happens for every request. It will take more time to convert If we have data controls such as Gridview,Treeview etc. The other cause of performance is ViewState. It does a good job that saves states between postbacks. However ViewState increases the pa...

Know Something more about Tenses in English

Already we have seen about tenses in  our previous articles.However here i am going to give  some shortcuts in this articles. 1.Simple Present Tense       Usages: Habit,Truth or fact.   Keywords: Every morning,weekly,seldom,always,often,sometimes,monthly,annually etc.   Example:   He studies every morning.   Do you work at night?   The sun rises in the morning. 2.Present Continuous Tense      Usages: A continuous action or event that is still going on.    Keywords: Now,at this moment    Example:    I am studying now.    She is cooking at the moment.    Are you reading? 3.Simple Past Tense     Usages: An action that takes place in the past,Habitual past action   Keywords :Last week,last month ,just now,two hours ago,in 2018,yesterday .   Example:   He ate lunch just now.   Prakash played football when he was young. ...

Memory types in Dotnet

Dotnet has 2 memory types. They are 1.Stack 2. Heap 1.Stack These are Value types which contain actual data. (e.g) Int, float, double,Boolean etc. 2.Heap These are reference types which contain pointers. These pointers point actual data. (e.g) String, object etc. The process of moving data from value type to reference type is called BOXING .The vice versa is called UNBOXING .

Common Language Runtime(CLR) in Dotnet

CLR(Common Language Runtime) is the Heart of Dotnet framework . It does 4 primary tasks. They are 1.Garbage collection 2.CAS(Code Access Security) 3.CV(Code Verification) 4.IL to Native translation 1.Garbage collection Garbage collector is a feature of CLR which cleans unused managed objects and reclaims memory. It doesn't clean unmanaged objects. It's a background thread which runs continuously for a specific intervals. 2.Code Access Security CAS is the part of Dotnet security model which determines what kind of rights does a Dotnet code have. 3.IL to Native translation This translation is done by the JIT(Just In Time) compiler. IL(Intermediate Language) is a partially compiled code).

String functions in C#

Today we are going to learn about string functionalities in C#. It is very essential to know the basic string functionalities.So that we can easily work with strings.Here I have listed few functionalities.I hope it would be more helpful. //Compiler version 4.0.30319.17929 for Microsoft (R) .NET Framework 4.5 using System; using System.Collections.Generic; using System.Linq; using System.Text.RegularExpressions; namespace StringFunctionalities {     public class Program     {         public static void Main(string[] args)         {             //Display string             string myString="Nothing will be interesting if you are not interested";             Console.WriteLine(myString);     ...

Indian States and their capitals

1. Andrapradesh -Amaravathi Important cities:Anantapur,Nellore,Machilipatnam 2.Arunachal pradesh -Itanagar Important cities:Tawang,along,Anini,Tezu 3.Assam -Dispur Important cities:Guwahati,Tezpur,Jorhar,Silchar 4.Bihar -Patna Important cities:Haha,Siwan,Chhapra 5.Chhattisgarh -Raipur Important cities:Ambikapur,Bilaspur,durg 6.Goa -Panaji Important cities:Margao 7.Gujarat -Gandhi nagar Important cities:Ahmedabad,Surat, Rajkot,Bhuj 8.Haryana -Chandigarh Important cities:Kurukshetra,Hisar,Karnal,Jhajjar 9.Himachal Pradesh -Shimla Important cities: Dharmsala,Kullu,Solan 10.Jammu and Kashmir -Srinagar Important cities:Baramula,Anantnag,Lah,Kargil 11.Jharkhand -Ranchi Important cities:Bokaro,Dhanbad,Jamshedpur 12.Karnataka -Bengaluru Important cities:Mysuru,Kolar,Bijapur,Bidar 13.Kerala -Thiruvananthapuram Important cities:Kollam,Kottam,Palakkad, Kozhikode 14.Madya Pradesh -Bhopal Important cities:Uijain,Indore,Balaghat,Panna 15.Maharastra -Mumbai Important...

Difference between method and function in c#

*Methods return nothing *Functions return something

Difference between IApplicationBuilder.Use() and IApplicationBuilder.Run() in Dotnet core?

IApplicationBuilder.Use () *It is used under configure method of Startup class. *It is used to add middleware delegate to the application request pipeline. *It will call the next middleware in the pipeline. IApplicationBuilder.Run() *It is used under configure method of Startup class. *It is used to add middleware delegate to the application request pipeline. *It will not call the next middleware in the pipeline. System will stop adding middleware after this method.