Programming Applications and Frameworks - Blog

Friday, 15 February 2019

Introduction To Frameworks

Introduction To Frameworks


Declarative Programming Paradigm

  • In declarative programming paradigm, the programmer defines what needs to be accomplished by the program without defining how it needs to be implemented. In other words, the approach focuses on what needs to be achieved instead of instruction how to achieve it.


Imperative Programming Paradigm 

  • Imperative programming is a paradigm of computer programming in which the program describes a sequence of steps that change the state of the computer. Unlike declarative programming, which describes "what" a program should accomplish, imperative programming explicitly tells the computer "how" to accomplish it.


What are the differences between declarative paradigm and imperative paradigm?


Imperative Paradigm
Declarative Paradigm

  • The programmer focuses on how to perform tasks and how to track changes in state


  • The programmer focuses on what information is desired and what transformation are required

  • Order of execution is important
  • Order of execution has a low importance

  • Primary flow controls are loops , conditionals , and function calls
  • Primary flow controls are function calls and including recursions


Functional Programming

  • In computer science, functional programming is a programming paradigm. It is a style of building the structure and elements of computer programs that treats computation as the evaluation of mathematical functions and avoids changing-state and mutable data.


What is the lambda calculus in functional programming?

  • Lambda calculus is a framework developed by Alonzo Church in 1930s to study computations with functions. It 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.

What is the lambda expression in functional programming?

  • Lambda expressions are not only a powerful way to provide a shorthand notation for anonymous methods, but they are also used in functional programming. In Java , Java lambda expressions are new in Java 8. Java lambda expressions are Java's first step into functional programming. A Java lambda expression is thus a function which can be created without belonging to any class. A Java lambda expression can be passed around as if it was an object and executed on demand.


What is meant by "no side effects" and "referential transparency" in functional programming?

  • In a referential transparent program, a function/method invocation can be freely replaced with its return value without changing the program's semantics.
  • A side effect refers simply to the modification of some kind of states as, changing the value of a variable , writing some data to disk and enabling or disabling a button in the user interface.

Procedural Programming

  • Procedural programming is a programming paradigm that uses a linear or top-down approach. It relies on procedures or subroutines to perform computations. This is also known as imperative programming.


What are the difference between functional programming and procedural programming?



Functional ProgrammingProcedural Programming

  • Describes what to do


  • Describes how to do

  • State changes are non existence
  • State changes are important

  • Focuses on expressions
  • Focuses on statements


Key Features in Object Oriented Programming

  • Object oriented approach is to remove some of the flows encountered in the procedure oriented programming. Object oriented programming(OOP), treats data as a critical element in the program and does not allow it to flow freely around the system. Objects , classes , data abstraction , encapsulation , inheritance and polymorphism are some key features of object oriented programming.


Objects

  • Objects are the basic run-time entities in an object-oriented programming. They may represents a person, a place, a bank account, a table of data or any item that the program has to handle.


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.


Data Abstraction

  • Abstractions refer to the act of representing essential features without including background details or explanation.


Encapsulation

  • The wrapping up of data and functions into single unit is known as encapsulation.

Inheritance

  •  Inheritance is the process by which objects of one class acquire the properties of object of another class. The class whose members are inherited is called the Base class and the class that inherits those members is called Derived class. It supports class of hierarchical classification. The concept of inheritance provides the ideas of re usability. This means we can add essential features to an exciting class without modifying it.

Polymorphism

  •  Polymorphism is another OOP concept. Polymorphism means the ability to take more than one form. An operation may exhibit different behaviors at different instances.


Event Driven Programming

  • An event-driven program is one that largely responds to user events or other similar input. The concept of event-driven programming is an important one in application development and other kinds of programming, and has spawned the emergence of event handlers and other resources.


Software Runtime Architecture

Compiled Languages

  •  A compiled language is a programming language whose implementations are typically compilers, and not interpreters. 

Scripting Languages

  •  A scripting or script language is a programming language that supports scripts.In here , programs written for a special run-time environment that automates the execution of tasks that could alternatively be executed one-by-one by a human operator.


Markup Languages

  •  In computer text processing, a markup language is a system for annotating a document in a way that is syntactically distinguishable from the text.  The tools who have the knowledge to understand the markup languages can render(generate) the output.


What are the differences between a compiled language , scripting language and a markup language?


Compiled LanguagesScripting LanguagesMarkup Language

  • Source code is compiled


  • Source code is not compiled


  • Source code is not compiled


  • Used to transform data


  • Used to mediate between programs in order to generate data


  • Used to control the presentation of data


Role Of The Virtual Runtime Machine

  • In computing , a virtual machine is an emulation of a computer system. Virtual machines are based on computer architectures and provide functionality of a physical computer. Their implementations may involve specialized hardware , software or a combination.
  • There are different kinds of virtual machines , each with different functions.


System Virtual Machines

  • System virtual machines provide a substitute for a real machine. They provide functionality needed to execute entire operating systems. A hypervisor uses native execution to share and manage hardware , allowing for multiple environments which are isolated from one another , yet exist on the same physical machine. Modern hypervisors use hardware-assisted virtualization , virtualization-specific hardware , primarily from the host CPUs. 

Process Virtual Machines

  • They are designed to execute computer programs in a platform-independent environment
  • Some virtual machines , such as QEMU , are designed to also emulate different architectures and allow execution of software applications and operating systems written for another CPU or architecture. Operating system level virtualization allows the resources of a computer to be partitioned via the kernel. The terms are not universally interchangeable. 


The Way Of A JavaScript Code Is Executed


  • JavaScript is what is called a client side scripting language. That means that it is a computer programming language that runs inside an internet browser.
  • The way JavaScript works is interesting. Inside a normal web page we place some JavaScript code. 
  • When the browser loads the page , the browser has a built-in interpreter that reads the JavaScript code it finds in the page and runs it.
  • Defining an event handler as the value of an onclick or another HTML attribute is much like defining a JavaScript function: the code is not immediately executed. Event-handler execution is asynchronous. Since events generally occur when the user interacts with HTML objects , there is no way to predict when an event handler will be invoked.
  • Code inside functions or objects is run whenever that function or object is called. If it is called from code that is directly in the head or body of the page, then its place in the execution order is effectively the point at which the function or object is called from the direct code.


What Is The Run time?

  • JavaScript run time refers to where your JavaScript code is executed when you run it. That said , java script can be executed on google chrome , in which case our JavaScript runtime is version 8 , if on Mozilla , it is spidermonkey. If IE , then it is chakra and if on Node , again its versin 8.


Where Do We Find The Interpreter?

  • We don’t need any thing except our browser. Just open console tab in Developers tool in any browser. Start coding there. 
  • That's why it is also known as Universal interpreter. We can also consider installing Node.js and we can launch it in our command prompt by typing 'node'. It is much more flexible and not limited like browser JavaScript engine.


The Way Of The Output Of a HTML document is rendered

  • When an HTML document is loaded into a web browser , it becomes a document object.
  • The document object is the root node of the HTML document.
  • A web browser is a piece of software that loads files from a remote server and displays them allowing for user interactions. 
  • When we write some HTML, CSS and JavaScript, and attempt to open the HTML file in our browser, the browser reads the raw bytes of HTML from our hard disk (or network).
  • Then , the raw bytes of data are converted into characters.
  • At this point, the browser’s gone from raw bytes of data to the actual characters in the file.
  • These characters are further parsed into something called tokens.
  • Conceptually, you may see a token as some sort of data structure that contains information about a certain html tag. Essentially , an html file is broken down into small units of parsing called tokens. This is how the browser begins to understand what you have written. 
  • We can use HTML output tags( the <output> tag represents the result of a calculation) , HTML form tools etc.

CASE Tools


  • CASE stands for Computer Aided Software Engineering. It means , development and maintenance of software projects with help of various automated software tools.
  • CASE tools are set of software application programs , which are used to automate SDLC(Software Development Life Cycle) activities. CASE tools are used by software project managers , analysts and engineers to develop software system.
  • There are number of CASE tools available to simplify various stages of SDLC such as analysis tools , design tools , project management tools , database management tools , documentation tools are to name a few.
  • Use of CASE tools accelerates the development of project to produce desired result and helps to uncover flaws before moving ahead with next stage in software development.

    Diagram Tools

    • These tools are used to represent system components, data and control flow among various software components and system structure in a graphical form. For example, Flow Chart Maker tool for creating state-of-the-art flowcharts.

    Process Modelling Tools

    • Process modeling is method to create software process model, which is used to develop the software. Process modeling tools help the managers to choose a process model or modify it as per the requirement of software product. For example, EPF Composer.

    Project Management Tools

    • These tools are used for project planning, cost and effort estimation, project scheduling and resource planning. Managers have to strictly comply project execution with every mentioned step in software project management. Project management tools help in storing and sharing project information in real-time throughout the organization. For example, Creative Pro Office, Trac Project, Basecamp.


    Analysis Tools

    • These tools help to gather requirements, automatically check for any inconsistency, inaccuracy in the diagrams, data redundancies or erroneous omissions. For example, Accept 360, Accompa, CaseComplete for requirement analysis, Visible Analyst for total analysis.

    Design Tools

    • These tools help software designers to design the block structure of the software, which may further be broken down in smaller modules using refinement techniques. These tools provides detailing of each module and interconnections among modules. For example, Animated Software Design.


    Workbenches

    • A workbench is a software development tool designed to define , reuse and compose domain specific languages together with their integrated development environment. Workbenches support object oriented programming.
    • A workbench is a set of tools which supports a particular phase in the software process.
    • Those tools work together to provide comprehensive support.
    • Common services are provided which are used by all tools and and some data integration is supported.

    Open Workbenches

    • Control integration mechanisms are provided and the data integration protocols are public. New tools can therefore be added by users.
    • This workbench can be tailored to specif organizational needs.

    Closed Workbench

    • Many commercial workbenches are closed systems. The control and data integration protocols are proprietary. These are more common than open workbenches. 
    • It allows for tighter tool integration including presentation integration.
    • However , it is possible to integrate third-party tools and the user is tried to a single supplier.


    Programming Workbench

    • A set of tools to support program development.
    • First CASE workbenches. Include compilers , linkers , loaders etc.
    • Programming workbenches are often integrated around an abstract program representation which allows for tight integration of tools.


    Language-directed Workbench

    • Integrated around an abstract program representation.
    • The system editor has language knowledge and can edit the abstract abstraction representation rather than the source code text.
    • A range of program analysis tools maybe supported.
    • Allow multiple views of the program to be generated. 


    4GL Workbench

    • Provide facilities for developing 4GL programs.
    • Integrated around a database management system.
    • Very effective in developing business systems.


    Design And Analysis Workbench

    • Support the generation of system models during design and analysis activities.
    • Usually intended to support a specific structured method.
    • Provide graphical editors plus a shared repository.
    • May include code generators to create source code from design information.


    Testing Workbench

    • Testing workbenches provide provide a range of tools to reduce the time required and total testing costs.
    • Most testing workbenches are open systems because testing needs are organization-specific.
    • Difficult to integrate with closed design and analysis workbenches. 



    Environments For Different Types Of Software

    • The Software Development Life Cycle environments describe the activities and tools required to perform a particular process within the SDLC. They are also defined as controlled points where software engineers can carry out activities related to development , testing , installations and configurations. These environments are associated with the different phases that make the SDLC. 

    Testing Environment

    • This environment is closely aligned to the testing phase of the SDLC. The testing environment comprises the following components , the system integration testing environment and the user acceptance testing environment. The system integration testing environment includes the testing of the entire system being developed.  


    The Common Build Environment

    • This environment is closely aligned to the development phase of the SDLC. In this environment , software engineers merge the work done in the development environment. Within this environment , software engineers build systems. These are used to automate the process of software compilation. 

    The Development Environment

    • This environment is aligned to the development phase of the SDLC. This is where processes related to software development are carried out. The development environment contains a set of different processes and tools for programming. These are used to develop the final software. The development environment can also be a physical space where development takes place and where software engineers interact. Another example of the development environment is the integrated development environment or IDE. The IDE provides a platform where tools and development processes are coordinated in order to provide software engineers a convenient way of accessing the resources they require during the development process. 

    The Analysis And Design Environment

    • This environment is aligned to the planning and analysis phases of the SDLC. In this environment , the main process that take place include carrying out an in depth examination of the current system and the proposed system. The system architecture is also defined and includes developing the design of the hardware , software , and network requirements for the system. Within this environment , systems and business analysts work closely with software engineers.

    Plug-ins

    • 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.
    • Two plug-in examples are the Adobe Flash Player for playing videos and a for Java virtual machine for running applets.

    Libraries

    • In programming , a library is a collection of precompiled routines that a program can use. The routines , sometimes called modules , are stored in object format. Libraries are particularly useful for storing frequently used routines because you do not need to explicitly link them to every program that uses them. the linker automatically looks in libraries for routines that it does not find elsewhere.

    Frameworks

    • In computer systems, a framework is often a layered structure indicating what kind of programs can or should be built and how they would interrelate. Some computer system frameworks also include actual programs, specify programming interfaces, or offer programming tools for using the frameworks. A framework may be for a set of functions within a system and how they interrelate; the layers of an operating system; the layers of an application subsystem; how communication should be standardized at some level of a network; and so forth. A framework is generally more comprehensive than a protocol and more prescriptive than a structure

    What are the differences between a plug-in , a library and a Framework?


    Plug-in Library Framework

    • At the development time , the plugin is placed in the project


    • At the development time , libraries are added to the project


    • At the development time , the structure is created and the code is placed in necessary places


    • At the development time , some configurations are applied using the code


    • At the development time ,the necessary functions and methods are called using the given packages or modules or classes


    • At the development time , Libraries are used to write the code and additional libraries and plugins are added


    • At the run time , The plug-in will be invoked via the configurations


    • At the run time ,The library will be called by the code


    • At the run time , The framework will call your code (inverse of control)


    Additional Gold Facts


    JDK(Java Development Kit)

    • The JDK is used for developing java applets and apps. It is basically a software development environment. JDK includes JRE(Java Runtime Environment) which happens to be a loader / interpreter , a compiler called (javac) , a document generator (Javadoc) , an archiever (jar) , and other tools required in development.


    JRE(Java Runtime Environment)

    • Java Runtime Environment or JRE is also known as Java RTE. The Java Runtime Environment contains core classes and supporting files. It also contains Java Virtual Machine (JVM). It provides the runtime environment.

    What Are The Differences Between JDK and JRE?

    JDK JRE

    • JDK is a bundle of software that is used to develop Java based applications


    • JRE is an implementations of virtual machine which actually executes java programs


    • JDK is needed for developing java applications


    • JRE is a plug-in needed for running java


    • JDK needs more disk space as it contains the JRE along with the various development tools


    • JRE is smaller than JDK so it needs a less space


    Why you should have to edit PATH after installing JDK?

    • After installing the JDK, it’s a good idea to set the path.If you do not set the PATH variable, then you  you must specify the full path to the executable file every time that you run it. 
    • Java Development Kit(JDK) is a software kit which is used to develop java applications. To get output on console we use java and javac commands. These commands are in the bin folder .So we need to specify their location to execute these commands. Set path contains path of these commands. 
    • If you save your .java file in java bin folder then you don't need to specify the path as OS will automatically take the path.
    • To  set the PATH variable permanently, add the full path of the jdk-10\bin directory to the PATH variable. 
      1. C:\> "C:\Program Files\Java\jdk-10\bin\javac" MyClass.java


    Why you should need to set JAVA_HOME? 


    • Java_Home should print to a JDK not a JRE. Many apps don't care about the differences but it is significant for some.


    What is the difference between PATH and JAVA_HOME?

    • This is not the same path.
    • The setting the path environment is so your programs/compilers can run smoothly , like where ever you are you can always call java or javac. (not needing to type C:\javasdk\bin\java)
    • The JAVA_HOME tells where java is , C:\javasdk , so , java programs knows where to find jars and which java to use. 
    • The path must include : C:\javasdk\bin
    • We must have JAVA_HOME = C:\javasdk


    Java IDE's And Comparisons

    • Selecting and working with the right IDE or integrated development environment is a vital aspect of becoming a successful developer. The right IDE enables developers to handle class-path , create files , build command line arguments and much more.


    Eclipse

    • Eclipse has been in existence from the year 2001, ever since IBM released Eclipse as an open source platform. Managed by the non-profit Eclipse Foundation, this is used in both open source and commercial projects. Starting in a humble manner, this has now emerged as a major platform, which is also used in several other languages.
    • The greatest advantage of Eclipse is that it features a whole plethora of plugins , which makes it versatile and highly customizable. This platform works for you in the background , compiling code , and showing up errors as they occur. The entire IDE is organized in perspectives , which are essentially sort of visual containers , which offer a set of views and editors.
    • Eclipse's multitasking, filtering and debugging are yet other pluses. Designed to fit the needs of large development projects, it can handle various tasks such as analysis and design, product management, implementation, content development, testing, and documentation as well.


    Netbeans

    • Netbeans IDE can be used to develop software for all versions of Java ranging from Java ME up to the Enterprise Edition. Like Eclipse , netbeans also features a variety of plugins you can work with.
    • This IDE also offerstoos and editorswhich can be used for HTML , PHP , XML and Javascript and more. 
    • Netbeans scores over eclipse in that it features database support , with drivers for Java DB , MySQL , PostgreSQL , and Oracle.

    IntelliJ IDEA

    • IntelliJ offers support for a variety of languages , including Java , Scala , Groovy , Clojure and more. This IDE comes with features such as smart code completion , code analysis , and advanced refactoring. The commercial "Ultimate" version , which mainly targets the enterprise sector , additionally supports SQL , ActionScript , Ruby , Python and Php. 
    • IntelliJ too features several user-written plugins. It currently offers over 900 plugins , plus an additional 50+ in its enterprise version. Users are always welcome to submit more plugins by using its built-in Swing components.

    No comments:

    Post a Comment