Wednesday, October 12, 2022

Webservices — C# 👩🏻‍💻

 

Webservices — C# 👩🏻‍💻

There are a lot of definitions defined about web services. In simple terms, The Web service is any software system application or ant cloud technology that uses the standard protocols like ‘HTTP/ HTTPS’ to connect, interoperate and exchange the message mainly via XML — across the internet are defined as Webservices.

Why Webservices?

There are applications developed in different languages like C#,.NET, Java, node.js and Angular. Most of the time, these diverse programs require some form of communication to work together. Because they are written in separate programming languages, ensuring accurate communication between them becomes extremely difficult. Web services have a role in this. Web services provide a common platform for several applications written in different programming languages to connect with one another.

You can refer to more about the web services, components, and advantages, etc from the below references :

https://www.researchgate.net/publication/236860265_Introduction_to_Web_Services

How to start off the web service development by using C#?

  1. If you haven’t the Visual Studio IDE on your local machine, https://visualstudio.microsoft.com/downloads/ use this link to download and install.
  2. After you install the visual studio go to file->project or press Ctrl+Shirt+N

3. Then select .Net Framework ASP.NET web service application then name your project (I have named it MyFirstApplication) then click OK.

Then you can see the project and file structure similar to the below :

Right-click the Web application folder and select the Add->New Item

Search the word “web” in the search bar and in the filter you can find the web services and give a name to it and add (I have named-MyFirstWebForm1).

Now you have created the webform which contains the default method “HelloWorld()”. Now you are folder structure seems like below :

In the code you can see the default method something like this :

Run the application (running by using IIS Express in the Google Chrome Browser).

You Can see the below outputs:

  1. Select the default method

2. Click Invoke Button

TRY

  1. Change the return value from “Hello World ” to “Welcome to the Webservice Tutorial” and see the output
public string HelloWorld()
{
return “Welcome to the Webservice Tutorial”;
}

2. Adding a new method in the application.

[WebMethod]
public int Calculate()
{
return 2+2;
}

Run the application and The Output is :

It creates the additional method which we define in the code “Calculate()”

It will display the return value “2+2=4”.

This is how you have to create the web methods inside the web services.

Note:

If you don't define the method to [WebMethod] then you cant able see the method in the web service when you execute the application.

So Webservices will identify its methods as [WebMethod].

Please make sure to add in the code and execute it.

I have covered how to create the First web services by using the C# .NET framework. Will continue the rest in the upcoming blogs. So keep eye on my blogs 😉

Happy Coding 👩‍💻 and Keep Blogging

😎

Saturday, March 28, 2020

Flutter

              Small Introduction about Flutter 





I heard this term called 'Flutter' was taught in the second week of lectures in my final year. From that knowledge here I'm going to give some short explanation about flutter. Lets Start!!!! 🏃


 What is Flutter?

Flutter is an open-source and free framework to create high quality, high-performance mobile applications across mobile OS - Android &IOS. It provides a powerful, simple SDK to write mobile applications By using DART language (Dart is Google's Own Language). Flutter was released in May 2017.

There are many frameworks available for creating mobile applications. For developing mobile applications, 
  •     Android provides a native framework based on Java.
  •     IOS provides a native framework based on Objective -c / Swift.
Earlier, we have to write two different codes to both OS Android and IOS. But today we can overcome this problem, by using cross-platform applications. 



What is meant by Cross Platform applications???


  • To develop a mobile application for both OS we need two different languages as well as two different frameworks. These types of applications were named as "Cross Platform Applications". There are several tools available for cross-platform development and flutter is one of those.


Features of cross-platform applications

  • This type of platform has the ability to write one and deploy it on various platform eg: We can write the code once and can deploy in android or ios or even desktop.
  • From the developer side, it saves the time of and he and efforts of developers.

Why Flutter??

Widgets- Makes the flutter Unique


Flutter is all about widgets. It offers many ready to use widgets to create a modern application. These widgets are optimized for the mobile environment and designing the application. By using widgets is as simple as designing HTML.

Using a single language for front and backends

As we already know, Android separating its Ui and business logic Java/Kotlin files. But in Flutter we are using DART language for both front end and back end.

Easy and Less for Testing

We are using the same language for front and backend. SO we don't need much time and effort to test these files. So the QA process can be faster.

Other than these, flutter has many features.
  • Flutter is a modern and reactive framework.
  • Fast Development
  • High Performance.
  • Beautiful and attractive User interfaces
  • Runs on Multiple Platforms
  • To develop dart language is used, and it is easy to learn.

Advantages of Flutter

  • Developers need to write just a single code base for both applications.
  • Fast Development
  • Flutter offers great Developing tools, with hot reload and hot restart.
  • It has excelling UI because of widgets, Advanced API s.




Disadvantages of Flutter


  • Ui and business logic are intermixed. Now modern frameworks try to separate logic and UI as much as possible. So this is the Disadvangae in a flutter.
  • It does not support the browsers it only supports android and IOS Applications.
  • Since Dart is a new language for the developer, They need to learn the new technologies.
  • Less documentation






Conclusion

I touched The basic Information about  Flutter. Hope you found this post useful and interesting. Feel free to share your feedback and comments below.   


Thank you for being here and keep reading...
😃






Tuesday, May 28, 2019

React JS and Its features



  • React JS basically is an Open source javascript library which is used for building user interfaces specifically for single page applications. It used for handling view layer for web and mobile apps. React is also allows us to create reusable UI components. It was created by Jordon Walke, a software engineer working for Facebook. React first deployed on Facebook's news-feed in 2011 and on Instagram in 2012. 

  •  React allows developers to create web applications which can change data without reloading the page. The main purpose of react is to be fast, scalable and simple. It works only on user interfaces in application. This corresponding view in the MVC template. It can be used to combination of other javascript libraries of framework.

      

What are the React Features?

  • react Native :- React has native libraries which were announced by Facebook in 205, which provides the react architecture to native applications like IOS,Android and UPD.

  •  Single-way data flow:- In React, a set of immutable values are passed to the components rendered as properties in its HTML tags. Component cannot directly modify any properties but can pass a call back function will help of which we can do do modifications. This complete process is known as "properties flow down; actions flow up".

  • JSX :- In React, Instead of using regular Javascript for templating , it uses JSX. JSX is simple Javascript which allows HTML quoting and uses these HTML tag syntax to render sub components. HTML syntax is processed into Javascript calls of React Framework. We can also write in pure old Javascript.  





WHY REACT JS??


  • Now , the main question arises in front of us is why one should use React Js. There are so many open-source platforms foe making the frond-end web application development easier like Angular. Let us take a quick look on the benefits of React over other competitive technologies or frameworks. With the front-end world changing on a daily basis, its hard to devote time to learning a new framework especially when that framework could ultimately become a dead end. So if you are looking for the next best thing but you're feeling a Little bit lost in the framework jungle, I suggest checking out React.

     Simplicity 
  
✔ ReactJS is just simpler to grasp right way. The component-based approach , well-defined life cycle, and use of just plain JavaScript make React very simple to learn, build a professional web and support it. 



    Easy To Learn
 
  Anyone with a basic previous knowledge in programming can easily understand React.  For React you just need basic knowledge of CSS and HTML.   



  Native Approach  


✔ React can be used to create mobile applications. And React is a die-hard fan of reusability , meaning extensive code re-usability is supported. So at the same time, we can make IOS , Android and Wed Application.



Performance

✔ React does not offer any concept of a built-in container for dependency. You can browserify, Require JS which we can use via Babel, ReactJS-di to inject dependencies automatically.



Testability

✔ React applications are super easy to test. React views can be treated as functions of the state , so we can manipulate with state we pass to the ReactJS view and take look at the output and triggered actions, events, functions etc.



React Advantages


  • Uses Virtual DOM which is a javascript object. This will improve apps performance, since Javascript Virtual DOM is faster than regular DOM

  • Can be used on client and server side as well as with other frameworks.

  • Components and data patterns improve readability , which we can maintain larger apps.



Hope you have enjoyed this blog post. Feel free to give feedback and comments below.

Thank you for being here and keep reading... 😃✌

React Limitations


  • Covers only the view layer if the app, hence you still need to choose other technologies to get a complete tooling set for further development

  • Uses inline templating and JSX , which might seem awkward to some developers.




Monday, May 20, 2019

Express JS and Hello-world Program in Webstrom

Express JS 💬


  • We all heart about java,c ,c#,c++ languages and so on. less us get to know about these new technology details which are ruling today's programming world.  we should eagerly know about these things. yes, here we know about the a web application framework. Express JS 💥

  •    Express.js is the most popular choice when it comes to built a web application with Node.js . It also a minimal and flexible Node.js web application framework that provides a robust set of features to develop web and mobile apps. It facilitates the rapid development of Node based web applications. Following are some of the features of Express framework :-

↦ Allows to setup middle wares to respond to HTTP Requests.

↦ Defines a Routing table which is used to perform different actions based on HTTP Method and URL.

↦ Allows to dynamically render HTML Pages based on passing arguments.


Installing Express.js

You can install Express.js using npm. 


this command will install version of express.js globally on our machine. so that every Node.js application on our machine can use it.



Hello World Example


Following is a very basic Express app which starts a server and listen port 8081 for connection. This app responds with 'Hello World!! We Started Working on Express :)for requests to the homepage.

1. open the Webstrom -> create a new Project

2. There are few options , you select the Node.js Express App
  

3. Give a Project name as you wish. (In my case it was HelloWorldExpress).



4.  Create the helloworld.js javascript file and write the following code







5. Run the helloworld.js and observe the console first.
   



6. Now Open http://127.0.0.1:8082/ in any browser to see the following result:





Now see the Coding,





Code Explanation:


  1. In our first line of code, we are using the require function to include "express Module".
     2. Before we can start the express module, we need to make an object of the express module.

     3. Here we are creating a callback function. This function will be called whenever anybody browses to the root of our web application. it will be used to send the string 'Hello world!! We are started working on Express' to the web page.

     4. In the callback function, we are sending the string 'Hello world!! We are started working on Express' to the client. The "res" parameter is used to send content back to the web page. This "res" parameter is something that is provided by the "request" module to enable one to send content back to the web page.

     5. We are then using the listen to function to make our server application listen to client requests. 



Advantages of Express.js



  • Makes Node.js Web application development fast and easy
  • Easy to configure and customize.
  • Allows you to define an error handling middle ware.
  • Allows you to create REST API server.
  • Easy to connect with Databases such as mongoDB,MYSQL.


Monday, May 6, 2019

Spring Boot Framework Basics

Spring Boot Framework



  • Spring boot us an open source java-based framework used to create a micro services developed by Pivotal Team and used to build stand-alone and production ready spring application.

        first we'll see about the Micro Services. 👇

WHAT IS MICRO SERVICES? 

  • Micro services is an architecture that allows the developers to develop and deploy services independently. Each service running has its own process and this achieves the lightweight model to support business applications

           Benefits are: 
  1. Easy Deployment
  2. Simple Availability.
  3. Minimum Configuration.
  4.  Lesser Production Time.                                          
   





  • All in all , Spring boot is a project built on the top of the Spring Framework. It provides simpler and faster way to set up , configure and run both simple and web-based applications.


  • In the Spring core framework , you need to configure all the things for yourself. Hence, you can have a lot of configuration files such as XML descriptors. That's one out of the main problems the Spring boot solves for you. It smartly chooses your dependencies, auto-configure all the features you will want to use, and you an start your application with one click. Furthermore, it also simplifies the deployment process of your application.  

  • It can be a bit frightening for few of you , because it seems that there a lot of "magic" things happening in the background. Despite that, I will explain some of the features of the framework. I hope this may helpful further.

Why Spring Boot?

you can choose Spring Boot because of the following  features and benefits.

  • It provides a flexible way to configure Java Beans, XML configurations, and Database Transactions.

  • It provides a powerful batch processing and manages REST endpoints.
  • In Spring Boot , everything is auto configured; no manual configuration needed.

  • Eases Dependency management.

  • It includes Embedded Servlet Container.




What is Brings?


  • Convention over Configuration
  • Standardization for micro services.
  • Integrated Server for development
  • Support for 3rd party Libraries.
  • Easier integration with Other frameworks.







Goals of Spring Boot


  • To avoid complex XML Configuration in Spring.
  • To develop a production ready Spring application in an Easier way.
  • To reduce the development time and run the application independently.
  • Offer an easier way of getting started with the application.


 Through out this blog post, You learned the basic stuffs about the Spring boot and why it is important . All in all, the above Servers on purpose :

           To get your program up and running as quick as possible 😃 😋



Feel free to share your feedback and comments below. Than you being here and keep reading.... 😃✌



Monday, April 15, 2019

Lambda Expression

 LAMBDA EXPRESSION



  • Lambda Expression is the one of the most important and biggest features in the jdk 8. It provides the clear and concise way to represent one method interface using an expression. The lambda expression is used to provide the implementation of an interface which has functional interface. it also helps to simplified the development alot. If you look at history and try to find out any language improvement in java in last 2 decades, you will not be able to recall many exciting things. Only few concurrent classes, generics and if you are agree then annotations as well, are remarkable additions in java in last decade. Lambda expression break this drought and feels like a pleasant gift.
        
In this Blog post, ill going to cover lambda expression and the basic concepts examples.                                                                                                                      
                    👉 Lambda expression small introduction in java
                           
                         👉 Java 8 functional interface

                         👉 Lambda expression examples.



  Lambda Expression small introduction in java

  • As I said earlier, it is an special features in java 8. and most welcoming by everyone. But the question is "Well, it is the function without the name and identifier. that's it But why everyone is so excited????? "😲🤔🤔🤔

  • The answer lies in the benefits involves in functional programming over oop(Object-Oriented Programming). Most OOP languages evolve around objects and instances and treat only them their first class citizens. this is specially true in java, where function can't  exist outside an object. a function itself does not mean anything in java, until it related to some object or instances.


  •   But in functional programming , you can define functions, give them reference  variables and pass them as method arguments and much more. JavaScript is a good  example of this where you can pass callback methods. its very useful feature and has been lacking in java from previous decades. Now in jdk 8, we can also use these things.
           
    

Syntax :- (a,b) - >  a+b ;  // This function has two parameters which are a and b. and it returns sum of these both.


Next, Have a look about Java 8 functional Interface.

2. Functional Interface in java 8


  • Single Abstract method Interface is not a new concept. it means interfaces with only one single method. We already had many examples. from jdk 8 , they will also be referred as functional interfaces as well. jdk 8 , enforces the rule of single responsibility by making these interfaces with  new annotation :- @FunctionalInterface .
     There is a good and well known example us Runnable Interface in thread. 



If i try to add a new method in any functional interface, compiler would not allow us to do this and will throw compile time error. 




So far good. But how they related to Lambda Expressions? 🤔
 Lets find 🏃

We know that Lambda expression is anonymous function with no name and they are passed to functions as parameters. Well in java methods parameters always have a type and this type information is looked for to determine which method needs to be called in case method overloading or even simple method calling. So normally, Every lambda expression also must be convertible to some type to be accepted as method parameters. Well that type in which lambda expressions are converted , are always of functional interface type. 


Example:- 



After use the Lambda Expression, The code will be: 



We can also see that Runnable is a functional Interface which does not allow more than one method . So when you pass lambda express to constructor of Thread class , compiler tries to convert the expression equivalent code as shown in first code sample,  If compiler succeed then everything runs fine, if compiler is not able to convert expression into equivalent implementation code, it will complain. 








3. Java 8 Lambda Expression Examples



1. Iterating over a List and perform some operations




2. Create a new runnable and pass it to thread



3. Adding an event listener to a GUI component



Above are very basic examples of lambda expression in java 8.

In the conclusion, I think this post might give the basic knowledge and examples of lambda expression to construct. Feel free to share your feedback and comments below.

Thank you for being here and keep reading..... 😃👍



Wednesday, April 10, 2019

Discussed about Some Features in previous Java Versions (7,8,9 and 10)

JAVA!!! 💭💻

Yes we all heard this term at least once  in several places in our developing environment.



Java is platform independent object oriented programming language and its main objective is write once run anywhere. It is a general-purpose programming language, it can be used to create all kinds of programs. It is used to developing mobile, web applications, server side and dynamic applications. java is a most populate and powerful language in computer programming. As a developer, just coding the applications is no longer helpful but also we should aware about the languages and had good knowledge is more and more useful in our career. In java we should know about the changes in the different versions which come across and made a good impact in Developments. So i'm going to share some knowledge about the changes in the some important java versions in recent times. Lets Start!!! 🏃


Java Version 


Evaluation of the java affects more impact in developments nowadays. Java language has undergone several changes since JDK 1.0 as well as numerous additions of  classes and packages to the standard library. There is much more dramatic changes have been made to the Java Class Library , over the years. 


here we are going to discuss about the features of the JDK 7,8,9 and 10.


JDK7 FEATURES


This is the major release after Oracle acquires Sun Micro Systems. It was launched on 7th of July 2011 but available for developers on July 2011. some additional features will added in this version.


1.In the JDK 7,We can able to use String datatype in Switch Statements.
           
  Example:- 
                       
                 




   2.   Single catch statement for throwing multiple exception by using " | "  operator.
   
         Example:-
      
           Prior to Java 7
                   
                      
          In java 7

             
    

3.  In Java 7 , we can use Underscore for Numeric Literals.


    Example:

           


But still some limitation are here:
  • Adjacent to a decimal point in a floating point
  • At the Beginning or end of a number.

  

4. No need close() Resource
  
 Resources like Input/Out Streams, Files, Connections should be closed manually by developer.Usually we use a try-finally block to close the respective resources. However, Java 7 has introduced another cool feature to manage the resources automatically. any object that implements java.lang.AutoClosable,which includes all objects which implement java.io.Closable, can be used as a resource. 

Prior to java 7






 In Java 7 


   



JDK8 FEATURES


Now that we have some idea about Java 7 and its new features . It was released on March 18, 2014. lets talk about what java 8 brought 🔎


1. Functional Interface
  
Functional Interfaces are new concept which is introduced by Java 8.Interface which contains only single method called as Functional Interface. in other-words, an interface which has exactly one abstract method becomes functional Interface. 

   Example:
   
       public Interface Test{
         
            public void doCalc(int i);
       }
  




2. Lambda Expression

It is an  another important and interesting feature which is introduced by Java 8. We can use Lambda Expression instead of implementing Anonymous class of an Interface that contains only one method. 

Prior to Java 8



In Java 8

Ill Explain more information about these Functional Interface and Lambda Expression in my upcoming posts. 👍


3. Default Method in Interface

  An interface is an 100% abstract class. It could have only abstract methods. The implementation of these methods has to be provided in a separate class. To overcome this problem Java 8 Introduced the concept of default methods which allows the interfaces to are implementation.  


       

     



Here the child class no need to override the method2() method but still we can call it. 





4. Static Default Method in Interface
   
  we can also have Static default method in interface which is a java 8 features. 





 Output is 








6. For-each Method

 ForEach library function is new in java 8 and it has made developers life Quicker and Easier. Collection classes which extends Iterable interface can use forEach loop to iterate elements.

Example:- 







JDK9 FEATURES


More than 3 years after the release of java 8, the next version java 9 released on September 21st of 2017. 


1. Private Interface Methods


  • Java 8 brought us default methods and static methods on interfaces. 
  • we can create private  method inside an interface. Interface allows us to declare private methods that help to share common code between non-abstract methods.

       Before Java 9 , Creating private methods inside an interface cause a compile time error. 



This is written JDK8 Version
Here , java 8 doesn't support the private method in interface.


                                             JDK 9 Code




2. Jshell


  • It is an interactive Java shell Tool, it allows us to execute Java code from the shell and displays  output immediately. 
  • Jshell is a Read Evaluate Print Loo tool and run from command line. it is good  for the test the business Logic.





JDK 10 FEATURES




 1. Local Variable Type References

Java now has now "var" style declarations. it allows you to declare a local variable without specifying its datatype.






2. Garbage Collector Interface

  • In earlier JDK Structure, the components that made up a Garbage Collector(GC) implementation were scattered throughout various parts of the code base
  • Its changed in Java 10,Now it is clean interface within the JVM source code to allow alternative collectors to be quickly and easily integrated.



Closing Up


I touched some of the Features in JDK 7,8,9 and 10. Hope you found this post useful and interesting. Feel free to to share your feedback and comments Below.   


Thank you for being here and keep reading...
😃


Webservices — C# 👩🏻‍💻

  Webservices — C# 👩🏻‍💻 There are a lot of definitions defined about web services. In simple terms, The Web service is any software syste...