background preloader

Advanced Theory/Papers

Facebook Twitter

JavaScript Inheritance via Prototypes and Closures | ruzee.com - Steffen Rusitschka. JavaScript as a prototypical language offers loads of solutions to implement classes and class inheritance. When coming from an Object Oriented language such as Java or Ruby, these solutions aren't obvious at the first glance. I started coding JavaScript years ago and always found a solution for my specific case.

But things felt messy and I always thought "Is this really the right way of doing it? ". Well, after all those years, experience took away this feeling and now I want to share some stuff that finally meant a break-through of understanding for me. There are two different concepts of doing inheritance in JavaScript. For both concepts I'll show you their basic idea and compact helpers for creating inheritance in an elegant way.

Let's start with the prototype-based concept. Prototype-based In JavaScript everything is relative to a function, e.g. the scope of local variables, or the this-keyword. The constructor of A is an empty function. New A(); basically does all the magic. Summary. Conal Elliott's home page. Supertech.csail.mit.edu/cilk/ Cilk Cilk (pronounced "silk") is a linguistic and runtime technology for algorithmic multithreaded programming developed at MIT. The philosophy behind Cilk is that a programmer should concentrate on structuring her or his program to expose parallelism and exploit locality, leaving Cilk's runtime system with the responsibility of scheduling the computation to run efficiently on a given platform. The Cilk runtime system takes care of details like load balancing, synchronization, and communication protocols.

Cilk is algorithmic in that the runtime system guarantees efficient and predictable performance. Click here for a brief introduction to Cilk. The Cilk-5.4.6 Reference Manual contains a programming guide with a short tutorial on the Cilk language. Cilk at Intel! MIT licensed Cilk technology to Cilk Arts, Inc.of Lexington, MA, a venture-funded start-up founded by Charles E. Awards SPAA Best Paper PLDI 10-Year Retrospective Award HPC Challenge Award Authors: Software: Documentation: Feedback. Circle-ellipse problem. The circle-ellipse problem in software development (sometimes known as the square-rectangle problem) illustrates a number of pitfalls which can arise when using subtype polymorphism in object modelling.

The issues are most commonly encountered when using object-oriented programming. The existence of the circle-ellipse problem is sometimes used to criticize object-oriented programming. It may also imply that hierarchical taxonomies are difficult to make universal, implying that situational classification systems may be more practical. The problem[edit] A sub-class has to provide support for all behaviour supported by the super-class; subclasses must implement any mutators defined in a base class. Some authors have suggested reversing the relationship between circle and ellipse, on the grounds that an ellipse is a circle with additional capabilities. The problem is sometimes expressed in statements such as "a Circle is not a sort of Ellipse".

Possible solutions[edit] Change the model[edit] SOLID Development Principles – In Motivational Pictures. I found the Motivator this morning. It lets you create your own motivational pictures. So, here’s my first run at creating the SOLID software development principles in motivational picture form. I ‘borrowed’ the images from google image search results. I hope you find them to be as fun as I do! ( I never expected the response to this post to be so great! Due to the continuous request for prints, posters, calendars, etc, we (LosTechies) are looking into what it would take to get these turned into high quality prints of various types.

Steve Smith and the NimblePros crew have created their own version of the posters, along with other principles, in a Calendar for 2011. Software development is not a Jenga game. (This one was created by Mark Nijhof ’s. Single Responsibility Principle Just because you can, doesn’t mean you should. ( I knew I had seen this Swiss Army knife in a Single Responsibility post before. Open Closed Principle Open chest surgery is not needed when putting on a coat. Duck typing. When I see a bird that walks like a duck and swims like a duck and quacks like a duck, I call that bird a duck.[1] In duck typing, a programmer is only concerned with ensuring that objects behave as demanded of them in a given context, rather than ensuring that they are of a specific type. For example, in a non-duck-typed language, one would create a function that requires that the object passed into it be of type Duck, in order to ensure that that function can then use the object's walk and quack methods.

In a duck-typed language, the function would take an object of any type and simply call its walk and quack methods, producing a run-time error if they are not defined. Instead of specifying types formally, duck typing practices rely on documentation, clear code, and testing to ensure correct use. Concept examples[edit] Consider the following pseudo-code for a duck-typed language: 9 [1, 2, 3, 4, 5, 6, 1, 2, 3, 4, 5, 6] apples and oranges, apples and oranges, apples and oranges, In C#[edit] Liskov substitution principle. Let be a property provable about objects of type . Then should be provable for objects where is a subtype of In the same paper, Liskov and Wing detailed their notion of behavioral subtyping in an extension of Hoare logic, which bears a certain resemblance with Bertrand Meyer's Design by Contract in that it considers the interaction of subtyping with pre- and postconditions. Principle[edit] Liskov's principle imposes some standard requirements on signatures that have been adopted in newer object-oriented programming languages (usually at the level of classes rather than types; see nominal vs. structural subtyping for the distinction): Origins[edit] A typical violation[edit] A typical example that violates LSP is a Square class that derives from a Rectangle class, assuming getter and setter methods exist for both width and height.

See also[edit] References[edit] General references Gary T. Specific references External links[edit] The Liskov Substitution Principle, T. Design by contract. A design by contract scheme The DbC approach assumes all client components that invoke an operation on a server component will meet the preconditions specified as required for that operation. Where this assumption is considered too risky (as in multi-channel client-server or distributed computing) the opposite "defensive design" approach is taken, meaning that a server component tests (before or while processing a client's request) that all relevant preconditions hold true, and replies with a suitable error message if not. History[edit] Design by contract has its roots in work on formal verification, formal specification and Hoare logic. The original contributions include: Description[edit] The central idea of DbC is a metaphor on how elements of a software system collaborate with each other on the basis of mutual obligations and benefits.

The contract is semantically equivalent to a Hoare triple which formalises the obligations. What does contract expect? Performance implications[edit] Lambda cube. The lambda cube. Direction of each arrow is direction of inclusion. In mathematical logic and type theory, the λ-cube is a framework for exploring the axes of refinement in Coquand's calculus of constructions, starting from the simply typed lambda calculus (written as in the cube diagram to the right) as the vertex of a cube placed at the origin, and the calculus of constructions (higher order dependently-typed polymorphic lambda calculus; written as λPω in the diagram) as its diametrically opposite vertex.

Each axis of the cube represents a new form of abstraction: Subtyping however is not represented in the cube, even though systems like , known as higher-order bounded quantification, which combines subtyping and polymorphism are of practical interest, and can be further generalized to bounded type operators. Allow the definition of purely functional objects; these systems were generally developed after the lambda cube paper was published.[1] See also[edit] Notes[edit] References[edit] Logical harmony. Logical harmony, a name coined by Sir Michael Dummett, is a supposed constraint on the rules of inference that can be used in a given logical system. The logician Gerhard Gentzen proposed that the meanings of logical connectives could be given by the rules for introducing them into discourse. For example, if one believes that the sky is blue and one also believes that grass is green, then one can introduce the connective and as follows: The sky is blue AND grass is green. Gentzen's idea was that having rules like this is what gives meaning to one's words, or at least to certain words.

The idea has also been associated with Wittgenstein's dictum that in many cases we can say, the meaning is the use. Most contemporary logicians prefer to think that the introduction rules and the elimination rules for an expression are equally important. In this case, and is characterized by the following rules: References[edit] Prior, Arthur. External links[edit] Vorlath - Halting Problem Diagonalization.

Game Pitches | Game Pitches. Service-oriented architecture. Service-oriented architecture (SOA) is a software design and software architecture design pattern based on discrete pieces of software providing application functionality as services to other applications. This is known as service-orientation. It is independent of any vendor, product or technology.[1] A service is a self-contained unit of functionality, such as retrieving an online bank statement.[2] Services can be combined by other software applications to provide the complete functionality of a large software application.[3] SOA makes it easy for computers connected over a network to cooperate. Every computer can run an arbitrary number of services, and each service is built in a way that ensures that the service can exchange information with any other service in the network without human interaction and without the need to make changes to the underlying program itself.

Overview[edit] SOA as an architecture relies on service-orientation as its fundamental design principle. Service-Orientation Design Principles. Service-orientation design principles are proposed principles for developing the solution logic of services within service-oriented architectures (SOA).[1][2][3] Overview[edit] The success of software development based on any particular design paradigm is never assured. Software developed under the service-oriented design paradigm carries even greater risks. This is because a service-oriented architecture usually spans multiple business areas and requires considerable initial analysis.

Therefore, SOA developed without concrete guidelines is very likely to fail.[4] To ensure that the move towards service-orientation is a positive change that delivers on its promised benefits, it is helpful to adopt a set of rules.[5] The service-orientation design principles may be broadly categorized as follows, following Thomas Erl's, SOA Principles of Service Design:[6][7][8] Strategic goals[edit] Characteristics[edit] Vendor-neutralBusiness-drivenEnterprise-centricComposition-centric Application[edit] Orchestration (computing) A somewhat different usage relates to the process of coordinating an exchange of information through web service interactions. (See also service-oriented architecture, and web service choreography.) Applications that decouple the orchestration layer from the service layer are sometimes called agile applications. [citation needed] A distinction is often made between orchestration (a local view from the perspective of one participant) and choreography (coordination from a global multi-participant perspective, albeit without a central controller).

[citation needed] Cloud service orchestration consists of these elements:[citation needed] Composing of architecture, tools, and processes used by humans to deliver a defined Service.Stitching of software and hardware components together to deliver a defined Service.Connecting and Automating of workflows when applicable to deliver a defined Service. Orchestration is critical in the delivery of cloud services for these reasons:[citation needed] Web Service Choreography. The main effort to get a choreography, The W3C Web Services Choreography Working Group, was closed on 10 July 2009[1] leaving WS-CDL as a Candidate Recommendation. Service Choreography[edit] Service choreography is a form of service composition in which the interaction protocol between several partner services is defined from a global perspective.[2] The intuition underlying the notion of service choreography can be summarised as follows: “Dancers dance following a global scenario without a single point of control" That is, at run-time each participant in a service choreography executes its part of it (i.e. its role) according to the behavior of the other participants.[3] A choreography's role specifies the expected messaging behavior of the participants that will play it in terms of the sequencing and timing of the messages that they can consume and produce.[4] History[edit] BPML, now BPMNBPSS by ebXML [3]WSFL by IBMXLANG by MicrosoftBPEL4WS by IBM, Microsoft and BEA See also[edit]

Component-based software engineering. An example of two components expressed in UML 2.0. The checkout component, responsible for facilitating the customer's order, requires the card processing component to charge the customer's credit/debit card (functionality that the latter provides). Component-based software engineering (CBSE) (also known as component-based development (CBD)) is a branch of software engineering that emphasizes the separation of concerns in respect of the wide-ranging functionality available throughout a given software system. It is a reuse-based approach to defining, implementing and composing loosely coupled independent components into systems. This practice aims to bring about an equally wide-ranging degree of benefits in both the short-term and the long-term for the software itself and for organizations that sponsor such software.

Software engineering practitioners regard components as part of the starting platform for service-orientation. Definition and characteristics of components[edit] History[edit] Service-orientation. Service-orientation has received a lot of attention since 2005 [4] due to the benefits it promises. These include increased return on investment, organisational agility and interoperability as well as a better alignment between business and IT. It builds heavily on earlier design paradigms and enhances them with standardisation, loose coupling and business involvement.[5] History of service-orientation principles and tenets[edit] In technology, different vendor SOA platforms have used different definitions of service-orientation.

Some vendors promote different principles and tenets over others, but a fair amount of commonality exists.[6] Don Box of Microsoft was one of the first to provide a set of design guidelines referred to as his "four tenets of service-orientation" which he described primarily in relation to the Microsoft Indigo (subsequently Windows Communication Foundation) platform that was emerging at the time: Business architectureSOASoftware oriented management Antecedents[edit] Prefer Composition over Inheritance. Evolve Your Hierarchy. JavaScript Programming Patterns. Elliott » Denotational design with type class morphisms. Papers/type-class-morphisms/type-class-morphisms-long.pdf.