Tutorial 01 - Introduction to the Frameworks


Programming Paradigms means a way and style of programming

01. Compare and Contrast declarative and imperative Paradigms

Declarative paradigmsIcomputer sciencedeclarative programming is a programming paradigm—a style of building the structure and elements of computer programs—that expresses the logic of a computation without describing its control flow.

1.Don t allow side effects.
2.Sequence of the steps is not crucial.

Declarative paradigms that you know  from languages,like HTML,XML,CSS,SQL,HASKEL  and 
LISP




Imperative Paradigms
In computer science, imperative programming is a programming paradigm that uses statements that change a program's state. In much the same way that the imperative mood in natural languages expresses commands, an imperative program consists of commands for the computer to perform.

1.Allow side effects
2.Control flow is explicit how the operation took place step by step





02.Discuss the difference between procedural programming and functional programming

Procedural Programming


Procedural programming can be defined as a subtype of imperative programming as a programming paradigm based upon the concept of procedure calls, in which statements are structured into procedures (also known as subroutines or functions). Procedure calls are modular and are bound by scope. A procedural program is composed of one or more modules. Each module is composed of one or more subprograms. Modules may consist of procedures, functions, subroutines or methods, depending on the programming language. Procedural programs may possibly have multiple levels or scopes, with subprograms defined inside other subprograms. Each scope can contain names which cannot be seen in outer scopes.
Procedural programming offers many benefits over simple sequential programming since procedural code:
  • is easier to read and more maintainable
  • is more flexible
  • facilitates the practice of good program design
  • Tends to emphasize implementing solutions in a linear fashion


Functional Programming
In computer science, functional programming is a programming paradigm—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.



1.often recursive
2.Always returns the same output for a given input
3.Good fit for parallel execution.
4.May have the feature of lazy Evaluation








03.Explain the Lambda calculus an Lambda expressions in functional programming

Functional programming (Lambda calculus)
Lambda calculus is a framework developed by 1930 Alonzo church

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



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

Referential Transparency
Referential transparency is a property of a specific part of a program or a programming language, especially functional programming languages like Haskell and R. An expression in a program is said to be referentially transparent if it can be replaced with its value and the resulting behavior is the same as before the change. This means that the program's behavior is not changed whether the input used is a reference or an actual value that the reference is pointing to.



No Side Effects
A Function or expression is said to have a side effect if it modifies some state outside it s local enviornment that is to say has an observable interaction with the  outside world besides returning a value ...in functional programming ,side effects are rarely used.



05.Discuss the key features of Object Oriented Programming

Abstraction

This is focuses on the essential characteristics of some object , relative to the perspective of the viewer



Encapsulation
Hides the details of  the implementation of an object.
Encapsulation in Java is a mechanism of wrapping the data (variables) and code acting on the data (methods) together as a single unit. ... Declare the variables of a class as private. Provide public setter and getter methods to modify and view the variables values.


Polymorphism

Mechanism of wrapping the data(variables) and code acting on the data(methods) together as a single unit.
Polymorphism in Java is a concept by which we can perform a single action in different ways. ... Sopolymorphism means many forms. There are two types of polymorphism in Java: compile-time polymorphism and runtime polymorphism. We can perform polymorphism in java by method overloading and method overriding.

Inheritance
Inheritance in Java is a mechanism in which one object acquires all the properties and behaviors of a parent object. It is an important part of OOPs (Object Oriented programming system). The idea behind inheritance in Java is that you can create new classes that are built upon existing classes.




06.How the event driven programming is different from other programming paradigms 

In computer programmingevent-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 drivers (e.g., P in USB device driver stacks[1]).

For example a user action such as a mouse click,key press,or a message from the operating system or another program.

1.program waits for event

2.whenever something happens the program responds and does something





07.Compare and Contrast the Compiled languages ,Scripting languages, and Markup languages

Markup Language
markup language is a language which is used to represent structured data. ... A scripting language is a programming language which is interpreted, rather than compiled, which means that scripting languages represent a subset of all programming languages

Scripting Language
scripting or script language is a programming language that supports scripts — 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. Scripting languages are often interpreted (rather than compiled).

Compiled Language
compiled language is a programming language whose implementations are typically compilers (translators that generate machine code from source code), and not interpreters (step-by-step executors of source code, where no pre run time translation takes place).



08.Discuss the role of the virtual run time machine

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 bytecode. 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.
The JVM reference implementation is developed by the Open JDK project as open source code and includes a JIT compiler called HotSpot. The commercially supported Java releases available from Oracle Corporation are based on the OpenJDK runtime



09.Find how the JS code is executed (What is the run time? where do you find the interpreter?

first 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,java script has no compilation step .instead an interpreter in browser reads over the java script code interprets each line ,and run it



10.Explain how the output of an HTML document is rendered,indicating the tools used to display the output.

Using html tags
ex:header tag
     div tag
     href tags
     links

     Doctype html
     <html>
     <head>
     </head>
     <body>
          <h1>hello world</h1>
          <h3> moditha dassanayake</h3>
     </body>
     </html>


Output

helloworld
moditha dassanayake




11. Identify different types of CASE tools, Workbenches, and Environments for different types of
software systems (web-based systems, mobile systems, IoT systems, etc.).
•Requirements – Surveying tools, analyzing tools
•Designing – Modelling tools
•Development – Code editors, frameworks,
libraries, plugins, compilers
•Testing – test automation tools, quality assurance
tools
• Implementation – VMs, containers/dockers,
servers

•Maintenance – bug trackers, analytical tools


•CASE software types
• Individual tools – for specific task
•Workbenches – multiple tools are combined,
focusing on specific part of SDLC
•Environments – combines many tools to support
many activities throughout the SDLC

12. Discuss the difference between framework, library, and plugin, giving some examples
Frameworks
•Framework is a collection of libraries, tools, rules,
structures, and control, to build software
systems
At development time
• Create the structure of the application
• Place your code in necessary places
• You may use the given libraries to write your code
• You can include additional libraries and plugins
At run time
• The framework will call your code (inverse of

control)


Libraries
Libraries provide an API, the coder can use it
to develop some features, when writing code
At development time
•Add the library to the project (source code files,
modules, packages, executables, etc.)
•Call the necessary functions/methods using the
given packages/module/classes
At run time
•The library will be called by the code


Plugins
•Plugins provide specific tools for
development
At development time
•The plugin (source code files, modules, packages,
executables, etc.) is placed in the project,
•Apply some configurations using code
At run time
•The plug-in will be invoked via the configurations



Comments