Programming Architecture and Framework


Compare and contrast declarative and imperative paradigms.

Declarative programming

 This is the form or style of programming where we are most concerned with what we want as the answer, or what would be returned. Here, we as developers are not concerned with how we get there, simply concerned with the answer that is received.
Declarative Programming is like asking your friend to draw a landscape. You don’t care how they draw it, that’s up to them.

Imperative programming

 This is the form and style of programming in which we care about how we get to an answer, step by step. We want the same result ultimately, but we are telling the compiler to do things a certain way in order to achieve that correct answer we are looking for.
Imperative Programming is like your friend listening to Bob Ross tell them how to paint a landscape. While good ole Bob Ross isn’t exactly commanding, he is giving them step by step directions to get the desired result.

Difference between Procedural programming and Functional programming

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.
Procedural programming is also known as imperative programming.

Functional Programming
Functional programming, or FP, is a programming paradigm for developing software using functions. Following the FP philosophy entails foregoing things like shared states, mutable data and side effects. Functional programming is a declarative paradigm because it relies on expressions and declarations rather than statements.




Explain the Lambda calculus and Lambda expressions in functional programming.  

Functional programming is a programming paradigm that treats computation as the evaluation of mathematical functions and avoids state and mutable data. It emphasizes the application of functions, in contrast with the imperative programming style that emphasizes changes in state. Lambda calculus provides a theoretical framework for describing functions and their evaluation. Though it is a mathematical abstraction rather than a programming language, it forms the basis of almost all functional programming languages today. Modern functional languages can be viewed as embellishments to the lambda calculus.



What is meant by “no side-effects” and “referential transparency” in functional programming ?



"Referential transparency" is an oft-touted property of (pure) functional languages, which makes it easier to reason about the behavior of programs. I don’t think there is any formal definition, but it usually means that an expression always evaluates to the same result in any context. Side effects like (uncontrolled) imperative update break this desirable property. C and ML are languages with constructs that are not reverentially transparent.

A function that returns always the same result for the same input is called a pure function. A pure function, therefore, is a function with no observable side effects, if there are any side effects on a function the evaluation could return different results even if we invoke it with the same arguments. We can substitute a pure function with its calculated value


"no side-effects"Functional programming is based on the simple premise that your functions should not have side effects; they are considered evil in this paradigm. If a function has side effects we call it a procedure, so functions do not have side effects. We consider that a function has a side effect if it modifies a mutable data structure or variable, uses IO, throws an exception or halts an error; all of these things are considered side effects. The reason why side effects are bad is because, if you 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.


Discuss the key features of Object Oriented Programming


Encapsulation


Encapsulation is one of the fundamentals of object oriented programming. It refers to the bundling of data with the methods that operate on that data.Encapsulation is used to hide the values or state of a structured data object inside a class, preventing unauthorized parties' direct access to them. Publicly accessible methods are generally provided in the class (so-called getters and setters) to access the values, and other client classes call these methods to retrieve and modify the values within the object.
This mechanism is not unique to object-oriented programming. Implementations of abstract data type, e.g. modules, offer a similar form of encapsulation. This similarity stems from the fact that both notions rely on the same mathematical fundamental of an existential type.

Abstraction

Abstraction  is the process of taking away or removing characteristics from something in order to reduce it to a set of essential characteristics. In object-oriented programming, abstraction is one of three central principles . Through the process of abstraction, a programmer hides all but the relevant data about an object in order to reduce complexity and increase efficiency. In the same way that abstraction sometimes works in art, the object that remains is a representation of the original, with unwanted detail omitted. The resulting object itself can be referred to as an abstraction, meaning a named entity made up of selected attributes and behavior specific to a particular usage of the originating entity. Abstraction is related to both encapsulation and data hiding.


Inheritance

In object-oriented programming, inheritance is the concept that when a class of objects is defined, any subclass that is defined can inherit the definitions of one or more general classes. This means for the programmer that an object in a subclass need not carry its own definition of data and methods that are generic to the class (or classes) of which it is a part. This not only speeds up program development; it also ensures an inherent validity to the defined subclass object (what works and is consistent about the class will also work for the subclass).



Polymorphism

Polymorphism is the provision of a single interface to entities of different types or the use of a single symbol to represent multiple different types.



How the event-driven programming is different from other programming paradigms?  




Event-driven programming is a paradigm used to structure a program around various events. These events include user input events in graphical user interfaces and networking requests from websites and other online properties.
Until the invention of graphical user interfaces, most programs simply waited for users to enter a command through their keyboard. In the meantime, the program would simply wait. The creation of graphical interfaces and the windows paradigm, however, forced developers to rethink their earlier strategies. Because users can click virtually anywhere, the program must be read for nearly any input. In addition, information isn't always entered in the same manner; event-driven programming makes it easier to handle a diverse range of inputs.
Event-driven programming also has some advantages for online resources. Instead of sending a static page to visitors, websites can instead change what is returned based on events. JavaScript, in particular, is often used for event-driven paradigms, and its use has transformed the Internet and led to a number of creative designs.
Event-driven programming is significantly harder for beginners than other programming paradigms, so most instructional courses and books avoid teaching it at first. After gaining skills in more traditional programming techniques, however, most students are able to understand and use it.
  

Compare and contrast the Compiled languages, Scripting languages, and Markup languages.


Compiled Language

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

Programs compiled into native code at compile time tend to be faster than those translated at run time, due to the overhead of the translation process. Newer technologies such as just-in-compilation, and general improvements in the translation process are starting to narrow this gap, though. Mixed solutions using bytecode tend toward intermediate efficiency.

Scripting Language

A 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). Primitives are usually the elementary tasks or API calls, and the language allows them to be combined into more complex programs. Environments that can be automated through scripting include software applications, web pages within a web browser, usage of the shells of operating systems (OS), embedded systems, as well as numerous games. A scripting language can be viewed as a domain-specific language for a particular environment; in the case of scripting an application, it is also known as an extension language. Scripting languages are also sometimes referred to as very high-level programming languages, as they operate at a high level of abstraction, or as control languages, particularly for job control languages on mainframes.


Markup Language

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 idea and terminology evolved from the "marking up" of paper manuscripts, i.e., the revision instructions by editors, traditionally written with a blue pencil on authors' manuscripts. In digital media, this "blue pencil instruction text" was replaced by tags, that is, instructions are expressed directly by tags or "instruction text encapsulated by tags." However the whole idea of a mark up language is to avoid the formatting work for the text, as the tags in the mark up language serve the purpose to format the appropriate text (like a header or the beginning of a paragraph etc.). Every tag used in a Markup language has a property to format the text we write.


Discuss the role of the virtual runtime machines.


A virtual machine (VM) is an operating system (OS) or application environment that is installed on software, which imitates dedicated hardware. The end user has the same experience on a virtual machine as they would have on dedicated hardware.
Specialized software, called a hypervisor, emulates the PC client or server's CPU, memory, hard disk, network and other hardware resources completely, enabling virtual machines to share the resources. The hypervisor can emulate multiple virtual hardware platforms that are isolated from each other, allowing virtual machines to run Linux and Windows Server operating systems on the same underlying physical host. Virtualization limits costs by reducing the need for physical hardware systems. Virtual machines more efficiently use hardware, which lowers the quantities of hardware and associated maintenance costs, and reduces power and cooling demand. They also ease management because virtual hardware does not fail. Administrators can take advantage of virtual environments to simplify backups, disaster recovery, new deployments and basic system administration tasks.
Virtual machines do not require specialized, hypervisor-specific hardware. Virtualization does, however, require more bandwidth, storage and processing capacity than a traditional server or desktop if the physical hardware is going to host multiple running virtual machines. VMs can easily move, be copied and reassigned between host servers to optimize hardware resource utilization. Because VMs on a physical host can consume unequal resource quantities -- one may hog the available physical storage, while another stores little -- IT professionals must balance VMs with available resources.


How the JS code is executed ?

JavaScript runs on a web browser but for that you need to include your java script code in a html file and open the file in a web browser. There are two ways you can include java script code in a html file: Use the script tag to write the java script code directly in the html file it self.

JavaScript interpreter in JavaScript. Instead of trying to create an interpreter from scratch, Spider Monkey is compiled into LLVM and then emscripten translates the output into JavaScript.




Identify different types of CASE tools, Workbenches, and Environments for different types of software systems



CASE tools are set of software application programs, which are used to automate SDLC 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 Software Development Life Cycle 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.

Real CASE tools - can be separated into three different categories, depending on where in the development process they are most involved in:
  • Upper - support analysis and design phases
  • Lower - support coding phase
  • Integrated - also known as I-CASE support analysis, design and coding phases





Discuss the difference between framework, library, and plugin


Framework


In general, a framework is a real or conceptual structure intended to serve as a support or guide for the building of something that expands the structure into something useful.
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.
Examples of frameworks that are currently used or offered by standards bodies or companies include:
  • Resource Description Framework, a set of rules from the World Wide Web Consortium for how to describe any Internet resource such as a Web site and its content.
  • Internet Business Framework, a group of programs that form the technological basis for the mySAP product from SAP, the German company that markets an enterprise resource management line of products
  • Sender Policy Framework, a defined approach and programming for making e-mail more secure
  • Zachman framework, a logical structure intended to provide a comprehensive representation of an information technology enterprise that is independent of the tools and methods used in any particular IT business


Library


In computing, a library is a collection of similar objects that are stored for occasional use - most frequently, programs in source code or object code form, data files, scripts, templates, fonts, and physical storage units such as tape cartridges. Here are some common types of libraries.
1) A program library is a collection of (usually) precompiled, reusable programming routines that a programmer can "call" when writing code so that the programmer doesn't have to write it. A dynamic link library (DLL) is one type of program library. Another type of program library is a class library, whose stored routines are class definitions in object-oriented programming (OOP). Graphical user interface (GUI) components such as scroll bars, buttons, and windowing routines are generally stored in a class library.
2) A storage library is a collection of physical storage media such as tapes or disks and a way to access them. A tape library, for example, contains tape cartridges and a mechanism that moves them into and out of the drive(s) where their content is read or updated.
3) A data library is the area of a data center (a centralized area housing computer systems and equipment) where storage media are archived. Online service providers also sometimes refer to a directory on a server containing files for downloading as a data library.
4) A virtual library is simply the online version of the traditional library. Books and documents are made available over the Web, and may be read on line or downloaded.


Plug-in

n computing, a plug-in (or plugin, add-in, addin, add-on, or addon) is a software component that adds a specific feature to an existing computer program. When a program supports plug-ins, it enables customization.
Web browsers have historically allowed executables as plug-ins, though they are now mostly deprecated. (These are a different type of software module than browser extensions.) Two plug-in examples are the Adobe Flash Player for playing videos and a Java virtual machine for running applets.
A theme or skin is a preset package containing additional or changed graphical appearance details, achieved by the use of a graphical user interface (GUI) that can be applied to specific software and websites to suit the purpose, topic, or tastes of different users to customize the look and feel of a piece of computer software or an operating system front-end GUI (and window managers).

Comments