General Flashcards
(47 cards)
Fingerprinting
Fingerprinting is a technique that makes the name of a file dependent on the contents of the file. When the file contents change, the filename is also changed. For content that is static or infrequently changed, this provides an easy way to tell whether two versions of a file are identical, even across different servers or deployment dates.
Cache busting
When a filename is unique and based on its content, HTTP headers can be set to encourage caches everywhere (whether at CDNs, at ISPs, in networking equipment, or in web browsers) to keep their own copy of the content. When the content is updated, the fingerprint will change. This will cause the remote clients to request a new copy of the content.
CDN
A content delivery network or content distribution network (CDN) is a large distributed system of servers deployed in multiple data centers across the Internet. The goal of a CDN is to serve content to end-users with high availability and high performance. CDNs serve a large fraction of the Internet content today, including web objects (text, graphics and scripts), downloadable objects (media files, software, documents), applications (e-commerce, portals), live streaming media, on-demand streaming media, and social networks.
Single Responsibility Principle
In object-oriented programming, the single responsibility principle states that every class should have a single responsibility, and that responsibility should be entirely encapsulated by the class. All its services should be narrowly aligned with that responsibility.
SOLID (Principles)
In computer programming, SOLID (Single responsibility, Open-closed, Liskov substitution, Interface segregation and Dependency inversion) is a mnemonic acronym introduced by Michael Feathers for the “first five principles” named by Robert C. Martin[1][2] in the early 2000s[3] that stands for five basic principles of object-oriented programming and design. The principles, when applied together, intend to make it more likely that a programmer will create a system that is easy to maintain and extend over time.[3] The principles of SOLID are guidelines that can be applied while working on software to remove code smells by causing the programmer to refactor the software’s source code until it is both legible and extensible. It is part of an overall strategy of agile and adaptive programming.[3]
The Open/Closed Principle
In object-oriented programming, the open/closed principle states “software entities (classes, modules, functions, etc.) should be open for extension, but closed for modification”. That is, such an entity can allow its behaviour to be extended without modifying its source code. This is especially valuable in a production environment, where changes to source code may necessitate code reviews, unit tests, and other such procedures to qualify it for use in a product: code obeying the principle doesn’t change when it is extended, and therefore needs no such effort.
Liskov Substitution Principle
Substitutability is a principle in object-oriented programming. It states that, in a computer program, if S is a subtype of T, then objects of type T may be replaced with objects of type S (i.e., objects of type S may substitute objects of type T) without altering any of the desirable properties of that program (correctness, task performed, etc.). More formally, the Liskov substitution principle (LSP) is a particular definition of a subtyping relation, called (strong) behavioral subtyping, that was initially introduced by Barbara Liskov in a 1987 conference keynote address entitled Data abstraction and hierarchy. It is a semantic rather than merely syntactic relation because it intends to guarantee semantic interoperability of types in a hierarchy, object types in particular.
Chain-of-responsibility Pattern
In object-oriented design, the chain-of-responsibility pattern is a design pattern consisting of a source of command objects and a series of processing objects.[1] Each processing object contains logic that defines the types of command objects that it can handle; the rest are passed to the next processing object in the chain. A mechanism also exists for adding new processing objects to the end of this chain.
This pattern promotes the idea of loose coupling, which is considered a programming best practice.
REST(ful)
Representational State Transfer (REST) is a software architecture style consisting of guidelines and best practices for creating scalable web services. REST is a coordinated set of constraints applied to the design of components in a distributed hypermedia system that can lead to a more performant and maintainable architecture.
REST has gained widespread acceptance across the Web as a simpler alternative to SOAP and WSDL-based Web services. RESTful systems typically, but not always, communicate over the Hypertext Transfer Protocol with the same HTTP verbs (GET, POST, PUT, DELETE, etc.) used by web browsers to retrieve web pages and send data to remote servers.
Web-Service
A Web service is a method of communication between two electronic devices over a network. It is a software function provided at a network address over the Web with the service always on as in the concept of utility computing. The W3C defines a Web service generally as:
A software system designed to support interoperable machine-to-machine interaction over a network.
We can identify two major classes of Web services:
- REST-compliant Web services, in which the primary purpose of the service is to manipulate XML representations of Web resources using a uniform set of stateless operations;
- Arbitrary Web services, in which the service may expose an arbitrary set of operations.
XHR
XMLHttpRequest (XHR) is an API available to web browser scripting languages such as JavaScript. It is used to send HTTP or HTTPS requests to a web server and load the server response data back into the script. Development versions of all major browsers support URI schemes beyond http and https, in particular, blob URLs are supported.
Data from the response can be used to alter the current document in the browser window without loading a new web page, and despite the name of the API, this data can be in the form of not only XML but also JSON, HTML or plain text.The response data can also be evaluated by client-side scripting. For example, if it was formatted as JSON by the web server, it can be converted into a client-side data object for further use.
BDD
Behavior-driven development (BDD) is a software development process that emerged from test-driven development. It combines the general techniques and principles of TDD with ideas from domain-driven design and object-oriented analysis and design to provide software development and management teams with shared tools and a shared process to collaborate on software development.
TDD
Test-driven development is a software development process that relies on the repetition of a very short development cycle: first the developer writes an (initially failing) automated test case that defines a desired improvement or new function, then produces the minimum amount of code to pass that test, and finally refactors the new code to acceptable standards. Kent Beck, who is credited with having developed or ‘rediscovered’ the technique, stated in 2003 that TDD encourages simple designs and inspires confidence
HTTP Referer
HTTP referer is an HTTP header field that identifies the address of the webpage that linked to the resource being requested. By checking the referer, the new webpage can see where the request originated.
In the most common situation this means that when a user clicks a hyperlink in a web browser, the resulting request includes the referer field, which indicates the last page the user was on.
Referer logging is used to allow websites and web servers to identify where people are visiting them from, for promotional or statistical purposes.
CGI
Common Gateway Interface (CGI) is a standard method used to generate dynamic content on Web pages and Web applications. CGI, when implemented on a Web server, provides an interface between the Web server and programs that generate the Web content. These programs are known as CGI scripts or simply CGIs; they are usually written in a scripting language, but can be written in any programming language.
Sandy Metz’ 5 OO-Principles
- Classes can be no longer than 100 LOC
- Methods can be no longer than 5 LOC
- You can pass no more than 4 parameters
- Controller actions can only instantiate 1 object
- You can pass only one instance variable to a view
Model–View–Presenter
Model–view–presenter (MVP) is where the model–view–controller (MVC) pattern derives from. It is used mostly for building user interfaces. In MVP the presenter assumes the functionality of the “middle-man”. In MVP, all presentation logic is pushed to the presenter. It is engineered to facilitate automated unit testing and improve the separation of concerns in presentation logic:
- The model is an interface defining the data to be displayed or otherwise acted upon in the user interface.
- The view is a passive interface that displays data (the model) and routes user commands (events) to the presenter to act upon that data.
- The presenter acts upon the model and the view. It retrieves data from repositories (the model), and formats it for display in the view.
Reactor Pattern
The Reactor design pattern is an event handling pattern for handling service requests delivered concurrently to a service handler by one or more inputs. The service handler then demultiplexes the incoming requests and dispatches them synchronously to the associated request handlers.
All reactor systems are single threaded by definition, but can exist in a multithreaded environment.
Benefits
The reactor pattern completely separates application specific code from the reactor implementation, which means that application components can be divided into modular, reusable parts. Also, due to the synchronous calling of request handlers, the reactor pattern allows for simple coarse-grain concurrency while not adding the complexity of multiple threads to the system.
Limitations
The reactor pattern can be more difficult to debug[2] than a procedural pattern due to the inverted flow of control. Also, by only calling request handlers synchronously, the reactor pattern limits maximum concurrency, especially on Symmetric multiprocessing hardware. The scalability of the reactor pattern is limited not only by calling request handlers synchronously, but also by the demultiplexer.
Unit Testing
A software testing method by which individual units of source code, sets of one or more computer program modules together with associated control data, usage procedures, and operating procedures, are tested to determine whether they are fit for use. Intuitively, one can view a unit as the smallest testable part of an application. In procedural programming, a unit could be an entire module, but it is more commonly an individual function or procedure. In object-oriented programming, a unit is often an entire interface, such as a class, but could be an individual method. Unit tests are created during the development process. It is also known as component testing.
Ideally, each test case is independent from the others. Substitutes such as method stubs, mock objects, fakes, and test harnesses can be used to assist testing a module in isolation. Unit tests are typically written and run by software developers to ensure that code meets its design and behaves as intended.
Mock Object
In object-oriented programming, mock objects are simulated objects that mimic the behavior of real objects in controlled ways. Similar to a car designer that uses a crash test dummy to simulate the dynamic behavior of a human in vehicle impacts. If an actual object has any of the following characteristics, it may be useful to use a mock object in its place:
- The object supplies non-deterministic results
- It has states that are difficult to create or reproduce
- It is slow
- It does not yet exist or may change behavior;
- it would have to include information and methods exclusively for testing purposes
Dependency Injection
In software engineering, DI is a design pattern that implements inversion of control for software libraries, where the caller delegates to an external framework the control flow of discovering and importing a service or module. DI allows a program design to follow the dependency inversion principle where modules are loosely coupled. With DI, the client part of a program which uses a module or service doesn’t need to know all its details, and typically the module can be replaced by another one of similar characteristics without altering the client.
An injection is the passing of a dependency (a service) to a dependent object (a client). The service is made part of the client’s state. Passing the service to the client, rather than allowing a client to build or find the service, is the fundamental requirement of the pattern.
There are three common forms of dependency injection: setter-, interface- and constructor-based injection, where the responsibility of injecting the dependency lies upon the client, the service or the constructor method respectively.
Principle of least astonishment (POLA)
The principle of least astonishment applies to user interface and software design, from the ergonomics standpoint. It is alternatively referred to as the law or rule of least astonishment, or of least surprise. “If a necessary feature has a high astonishment factor, it may be necessary to redesign the feature.”
A textbook formulation is “People are part of the system. The design should match the user’s experience, expectations, and mental models.” What is least surprising may however depend on the expected audience, e.g. end users, programmers or system administrators.
In more practical terms, the principle aims to exploit users’ pre-existing knowledge as a way to minimize the learning curve for instance by designing interfaces borrowing heavily from “functionally similar or analogous programs with which your users are likely to be familiar.” User expectations in this respect may be closely related to a particular computing platform or tradition. In more abstract settings like an API, the expectation that function or method names intuitively match their behaviour is another example. This practice also involves the application of sensible defaults.
When two elements of an interface conflict, or are ambiguous, the behavior should be that which will least surprise the user; in particular a programmer should try to think of the behavior that will least surprise someone who uses the program, rather than that behavior that is natural from knowing the inner workings of the program.
AJAX
Ajax (short for asynchronous JavaScript and XML) is used on the client-side to create asynchronous Web apps. With Ajax, apps can send data to and retrieve from a server asynchronously (in the background) without interfering with the display and behavior of the existing page. Data can be retrieved using the XMLHttpRequest object. Despite the name, the use of XML is not required (JSON is often used in the AJAJ variant), and the requests do not need to be asynchronous.
Ajax is not a single technology, but a group of technologies. The DOM is accessed with JavaScript to dynamically display – and allow the user to interact with – the information presented. JavaScript and the XMLHttpRequest object provide a method for exchanging data asynchronously between browser and server to avoid full page reloads.
BLOB
A Binary Large OBject (BLOB) is a collection of binary data stored as a single entity in a database management system. Blobs are typically images, audio or other multimedia objects, though sometimes binary executable code is stored as a blob. Database support for blobs is not universal.
Blobs were originally just amorphous chunks of data invented by Jim Starkey at DEC, who describes them as “the thing that ate Cincinnati, Cleveland, or whatever” from “the 1958 Steve McQueen movie”, referring to The Blob. Later, Terry McKiever, a marketing person for Apollo, felt that it needed to be an acronym and invented the backronym Basic Large Object. Then Informix invented an alternative backronym, Binary Large Object.
“Blobbing” originally meant moving large amounts of data from one database to another without filters or error correction. This is fast because it puts the responsibility for error checking and filtering on the new host for the data.
The data type and definition was introduced to describe data not originally defined in traditional computer database systems, particularly because it was too large to store practically at the time the field of database systems was first being defined in the 1970s and 1980s.