Friday, February 15, 2019

Introduction to the Frameworks

In this article, we’ll concentrate on basic introduction of  programming application and frameworks.
Programming paradigms are a way to classify programming languages based on their features.
•E.g.  Functional programming,
         Object Oriented Programming

Programming languages can be classified into multiple paradigms.
•Non-structured programming (E.g. BASIC, FORTRAN, COBOL)
•Structured programming(E.g. Control structures Functions/procedures/methods ,Classes/modules)
•Event-driven programming



Some paradigms can be classified into multiple categories:
•E.g. Object Oriented Programming is structured and Imperative language

The two of the existing programming paradigms are:
       Imperative programming and Declarative  programming.

We’ll check the main features of both of them and try to understand what pros and cons they have.
Compare and contrast declarative and imperative paradigms.
Imperative paradigms:
In which the programmer instructs the machine how to change its state
using a sequence of code to explain the flow of execution
has side effects.
                  E.g:              add (x, y)
                                      {
                                           return x + y;
                                       }
                                       add(5, 9);

Declarative paradigms:
In which the programmer merely declares properties of the desired result but not how to compute it.
Does not describe how to accomplish the task as a sequence of the programming language primitives.
this helps to minimize side effects.
                   E.g:            
                               const sum= a=> b=> a + b;
                               print(sum(5) (3)); // 8

Now let see what is the meaning of Functional programming and Procedural programming
 Functional programming:
 A style of building the structure and elements of computer programs that treat computation as the evaluation of mathematical functions and avoids changing state and mutable data.

Procedural programming:
    derived from structured programming based upon the concept of the procedure call procedures also known as routines, methods, subroutines or functions.

A small definition about lambda calculus and lambda Expression under the Functional programming..
 Lambda calculus

    Lambda calculus (also written as λ-calculus) is a formal system in mathematical logic for expressing computation based on function abstraction and application using variable binding and substitution. It is a universal model of computation that can be used to simulate any Turing machine. It was first introduced by mathematician Alonzo Church in the 1930s as part of his research of the foundations of mathematics.

      Lambda Expression

A lambda expression is an anonymous function that provides a concise and functional syntax, which is used to write anonymous methods. It is based on the functional programming concept and used to create delegates or expression


 ⧫ What is meant by “no side-effects” and “referential transparency” in functional programming?
     No side-effects:
 your functions should not have side effects. If a function has side effects we call it a procedure.
the reason why side effects are bad is that if a had them a function can be unpredictable depending on the state of the system. when a function has no side effects we can execute it anytime.
It will always return the same result given the same input.
   
        Referential Transparency:
A pure function has no side effects. we can substitute a pure function with its calculated value, we can do so because it does not have any side effects. The ability to replace an expression with its calculated value is called referential transparency

Lets discuss the key features of Object Oriented Programming.

     ⧭ Objects:

Objects are the basic run-time entities in object-oriented programming. They may represent a person, a place, a bank account, a table of data or any item that the program has to handle. They may also represent user-defined data such as vector, time and lists. When the program is executed, the object interacts by sending a message to one another.

    ⧭  Classes:

Objects contain data, and code to manipulate that data. The entire set of data and code of an object can be made a user-defined data type with the help of class. In fact, objects are variable of the type class. Once a class has been defined, we can create a number of objects belonging to that class. A class is a collection of objects of similar type.

Ex. Fruit mango;

   ⧭ Encapsulation
    Encapsulation is one of the fundamental concepts in object-oriented programming (OOP). It describes the idea of bundling data and methods that work on that data within one unit, e.g., a class in Java.

This concept is also often used to hide the internal representation, or state, of an object from the outside. This is called information hiding. The general idea of this mechanism is simple. If you have an attribute that is not visible from the outside of an object and bundles it with methods that provide read or write access to it, then you can hide specific information and control access to the internal state of the object

 ⧭ Inheritance
Inheritance is one of the core concepts of object-oriented programming (OOP) languages. It is a mechanism where you can to derive a class from another class for a hierarchy of classes that share a set of attributes and methods.

You can use it to declare different kinds of exceptions, add custom logic to existing frameworks, and even map your domain model to  a database.






⧭ Data Abstraction:
Abstractions refer to the act of representing essential features without including background details or explanation. They are commonly known as Abstraction Data Type(ADT).



Now see how the event-driven programming is different from other programming paradigms:

In computer programming, event-driven programming is a programming paradigm in which the flow of the program is determined by events such as user actions (mouse clicks, key presses), sensor outputs, or messages from other programs or threads. Event-driven programming is the dominant paradigm used in graphical user interfaces and other applications (e.g., JavaScript web applications) that are centered on performing certain actions in response to user input. This is also true of programming for device driver

In an event-driven application, there is generally a main loop that listens for events and then triggers a callback function when one of those events is detected. In embedded systems, the same may be achieved using hardware interrupts instead of a constantly running main loop. Event-driven programs can be written in any programming language, although the task is easier in languages that provide high-level abstractions, such as await and closures.

Lets talk about the programming language,scripting language and markup language:

 Programming languages:
 Programming languages are languages which encode programs. Encoding means that a word in the language can be interpreted as a program (a sequence of actions). Computer programming languages are a subset of these. Examples of non-computer programming languages: a grocery list, interpreted as directions for a buyer in a supermarket, DNA interpreted by transcribing peptides, an analog musical record serving as a program for a tape recorder.

Computer programming languages are thusly the ones which program computers.

Scripting language:
A scripting language is used to mediate between programs in order to generate data. This is especially true of shell scripting languages like bash, but if you reflect about it, also Python or Perl came from the need to accomplish tasks in UNIX without writing a program in C. The program that you control most of the time in those languages is the interpreter of the language itself, which accomplishes general tasks for you. Other typical programs you interact with our database servers, or web servers.


Markup language:


A markup language is used to describe data rather than logic. A typical use of them is to describe document formatting, HTML is designed for this for example. But they are sometimes used as general data formats as well, XML is a markup language that is often used to just describe data.



Virtual run time machine
A Java virtual machine (JVM) is a virtual machine that enables a computer to run Java programs as well as programs written in other languages that are also compiled to Java byte code. The JVM is detailed by a specification that formally describes what is required of a JVM implementation. Having a specification ensures interoperability of Java programs across different implementations so that program authors using the Java Development Kit (JDK) need not worry about idiosyncrasies of the underlying hardware platform.

 JDK is a superset of JRE, and contains everything that is in JRE, plus tools such as the compilers and debuggers necessary for developing applets and applications. JRE provides the libraries, the Java Virtual Machine (JVM), and other components to run applets and applications written in the Java programming language.


After installing the JDK, it’s a good idea to set the path.
If you do not set the PATH variable, then you must specify the full path to the executable file every time that you run it.

Environment variables are strings that contain information such as drive, path, or file name. The JAVA_HOME environment variable points to the directory where the Java run time environment (JRE) is installed on your computer. The purpose is to point to where Java is installed.


 we don't recall that we've ever seen a JAVA_PATH environment variable. Many
applications will use JAVA_HOME and add ${JAVA_HOME}/bin to the PATH
environment variable though. For example:

JAVA_HOME=/usr/local/jdk1.4.2
PATH=${PATH}:${JAVA_HOME}/bin

JAVA_HOME is also used by many other applications like Tomcat and various
IDEs.


Find how the JS code is executed:

JavaScript is an interpreted language, not a compiled language. A program such as C++ or Java needs to be compiled before it is run. The source code is passed through a program called a compiler, which translates it into byte code that the machine understands and can execute. In contrast, JavaScript has no compilation step. Instead, an interpreter in the browser reads over the JavaScript code, interprets each line, and runs it.


   HTML is the standard markup language for creating Web pages.

    HTML stands for Hyper Text Markup Language
    HTML describes the structure of Web pages using markup
    HTML elements are the building blocks of HTML pages
    HTML elements are represented by tags
    HTML tags label pieces of content such as "heading", "paragraph", "table", and so on
    Browsers do not display the HTML tags but use them to render the content of the page

HTML comments are visible to anyone that views the page source code but are not rendered when the HTML document is rendered by a browser. The  <!DOCTYPE html> declaration is used to inform a website visitor's browser that the document being rendered is an HTML document.

CASE technology:

CASE technology is the automation of step by step methodologies for software and system development. CASE tools are characterized by the stage or stages of the software development life cycle on which they focus. Since different tools covering different stages share common information, it is required that they integrate through some central repository system (data dictionary) to have a consistent view of such information. In phases of software development life cycle integrated through a central data dictionary. Case Tools are used in many ways in our organizations. Case tools can be broadly classed into these broader areas:

    ..Requirement Analysis Tool
    ..Structure Analysis Tool
    ..Software Design Tool
    ..Code Generation Tool
    ..Test Case Generation Tool
    ..Document Production Tool
    ..Reverse Engineering Tool

  ⧪ Workbenches
       Workbenches integrate two or more CASE tools and support specific software-process activities. Hence they achieve:

   - a homogeneous and consistent interface (presentation integration).
    -seamless integration of tools and tool chains (control and data integration).

An example workbench is Microsoft's Visual Basic programming environment. It incorporates several development tools: a GUI builder, a smart code editor, debugger, etc. Most commercial CASE products tended to be such workbenches that seamlessly integrated two or more tools. Workbenches also can be classified in the same manner as tools; as focusing on Analysis, Development, Verification, etc. as well as being focused on the upper case, lower case or processes such as configuration management that span the complete life-cycle.

      Environments:
An environment is a collection of CASE tools or workbenches that attempts to support the complete software process. This contrasts with tools that focus on one specific task or a specific part of the life-cycle. In practice, the distinction between workbenches and environments was flexible. Visual Basic, for example, was a programming workbench but was also considered a 4GL environment by many. The features that distinguished workbenches from environments were deep integration via a shared repository or common language and some kind of methodology.

 Framework, Library, and Plugin....

 The key difference between a library and a framework is "Inversion of Control". When you call a method from a library, you are in control. But with a framework, the control is inverted: the framework calls you.

A library is just a collection of class definitions. The reason behind is simply code reuse, i.e. get the code that has already been written by other developers. The classes and methods normally define specific operations in a domain specific area. For example, there are some libraries of mathematics which can let the developer just call the function without redo the implementation of how an algorithm works.

In the framework, all the control flow is already there, and there's a bunch of predefined white spots that you should fill out with your code. A framework is normally more complex. It defines a skeleton where the application defines its own features to fill out the skeleton. In this way, your code will be called by the framework when appropriately. The benefit is that developers do not need to worry about if a design is good or not, but just about implementing domain-specific functions.

In computing, a plug-in is a software component that adds a specific feature to an existing computer program. When a program supports plug-ins, it enables customization....Programs may also implement plugins by loading a directory of simple script files written in a scripting language like Python.

0 comments:

Post a Comment