Week 2

Feedback:

  • Don't envoke strict mode on global scope. Strict mode is also added other libraries.
  • Cache stuff in variables (d.r.y) queryselector opslaan in variable.
  • Place <script> tag above closing body. Or with async and in defer in head. Loaded when dom is loaded. Cleaner to put in <head>, semantic correct.
  • Language, research in english.
  • Use meaningful variable names; short and descriptive.
  • Bind events instead of using event properties. Work with listeners
  • Don't wrap single elements with <section> elements.
  • Structure every good in an object, not in iffe.
  • Write short reflection for the week or assignment.

Lecture 1

Parse string naar javascript met JSON.parse. Nested structure of objects.
Between app and app. Data layer. Get data to the public. You can use micro-libraries in case it gets to much. Lib needs to do exactly what you want it to do.

6 reasons to use JS libraries

  • Don't reinvent the wheel
  • Do more with less code
  • Save Time
  • You aren't the expert.
  • Makers of frameworks focus on speed.
  • Avoid cryptic JavaScript code

No more JS frameworks.

Holy trinity was the standard for a long time. Over the past ten years, browsers got better. Evergreen browsers; automatically updating browsers. Why are we still writing frameworks? It's a habit.

gist (snippet)-> library -> framework

Frameworks aren't just big libraries, they have their own models for how to interact with events, with the DOM.

  • Abstractions; Two systems to learn, holy trinity and framework. So you need to know HTML+CSS+JS because at some point your program won't work the way you expect it to. A framework is like an iceberg, that 10% floating above the water doesn't look dangerous, it's the hidden 90% that will eventually get you.
  • Widgets; -
  • Data binding; The longer term problem with frameworks is that they end up being silos, they segment the landscape, widgets built for framework A don't work in framework B. That's lost effort.

a library providing an orthogonal piece of functionality that can be used with other libraries. Libraries are fine, it's the frameworks that demand 100% buyin that I'd like to see us move away from.

Micro library

Micro-frameworks are definitely the pocketknives of the JavaScript library world: short, sweet, to the point. A micro-framework does one thing and one thing only — and does it well. No cruft, no featuritis, no feature creep, no excess anywhere.

Templating

Transparency, handlebars, no react.

Routing

Vanilla js routing, google it. Routie.

<<<<<<< HEAD

Lecture 2

Promise is een constructor object. then of catch aanroepen.

What is ajax?

asynchronous JavaScript and XML. With Ajax, web applications can send data to and retrieve from a server asynchronously (in the background) without interfering with the display and behavior of the existing page.

Page doesn't have to refresh to get new content. The general use case of this is to be able to update a client's interface without needing to go to another page.

Asynchronous

Execution of processes are carried out simultaneously. Asynchronous means that the browser will make the AJAX request and continue doing other things. Synchronous means the browser will stop what it's doing until the AJAX call completes.

Slides

What are API's and how do they work?

Converstation between business stakeholders, operational efficiensies and the technical staff that has to deal with the infrastructure.

Api's s are User Interfaces, just with different users in mind.

That end user invariably consumes that data and/or functionality through a user interface (UI)—one that’s designed to make the act of consumption as easy and even enjoyable as possible.

An API is geared for consumption by software. Technology that allows applications (software programs) to talk to one another. Machine-readable interfaces

Part 1 - What is an API, exactly.

It’s important to think of the electricity as a service and of each device that uses electricity as a consumer of that service. The specification essentially sets an expectation on behalf of consuming devices. Likewise, an API specifies how software components should interact with each other.

Part 2 - What are the benefits of API's.

Imagine yourself what you would do if you didn't have wall sockets. We have plugs and sockets that conform to a standard.

  • Compatibel with every device (it's a standard) for consumers and device makers.
  • Consuming-devices are easily moved from one socket to another
  • Layer of abstraction to the underlying service.
  • The same transparency works both ways. To the service, all consumers look the same

A consuming application can outsource its requirements for data (such as a patient record) or functionality (such as a location represented as a pin on an interactive map) to a service through an application programming interface.

So, as with electricity, APIs can be consumed (to the extent that an application outsources certain requirements to an API) and provided as a service. Browsers offer a standard way for browser-based applications to access the host device’s storage, audio system, cameras, and much more.

Part 3 - How Web and Browser APIs Fuel The API Economy

Api's make developers more productive. Microsoft provided the API as means to access the windowing service in the Windows operating system, and the developers of the thousands of applications that run on Windows “consumed” that service through its API. Programmers simply make a reference to that API (more commonly referred to as “calling an API”), supplying it with the data they want Windows to save to the hard drive. Many APIs expect such inputs, otherwise known as parameters. The API takes care of the rest, just as a wall socket. They don’t have to “reinvent the wheel” with every new program they write. They can instead focus on the unique proposition of their applications while outsourcing all of the commodity functionality to APIs.

The return on investment compared to simply outsourcing that credit card processing to a best-of-breed API provider (like Stripe) makes the custom-code alternative financially infeasible.

The API economy’s growth is thusly driven by service providers, complex functionality into easily reused API-based components

Networkable API's are the game-changers
In other words, developers can also consume APIs that are offered by remote systems and devices that are reachable through a network. APIs involve an endpoint—essentially, a socket into which consuming applications are plugged.

Part 4 - How the API Principles of Abstraction Benefit API Providers

Because an API endpoint sufficiently decouples the consuming application from the infrastructure that provides a service, the service provider is afforded tremendous flexibility when it comes to how it offers its service. As long as the specification for what the service provider is delivering to the endpoint remains unchanged, the changes to the infrastructure behind the endpoint should go unnoticed by the applications that rely on that API.

Like a legal contract between two parties, this agreement between what the consuming application expects to see at the endpoint and what the API provider is providing at the endpoint is often called the “API contract.”

Part 5 - Why Did They Put the Web in Web APIs?

While there are no rules or laws governing exactly how developers must connect their applications to an API from across a network or the Internet, several approaches have emerged as de facto standards for achieving such connections and transmitting and receiving payloads. The site is relying on a special set of HTTP commands called "verbs" (including get, put and post) that are purpose-built for such client/server exchanges of data.

Web address is different from the one that a browser would connect to in order to get the same information. API endpoints that are addressable over the Web and that support the HTTP command structure are often said to be “Web APIs.” The Web has turned into a programmable platform that’s equally, if not more, powerful than programmable platforms including Windows.

Also, whereas some APIs are designed to query or update a database, other APIs simply initiate a process. Depending on the volume of API calls, an API provider like Google might charge the application developer a fee for using the API. hen that’s the case, the application developer must weigh all the costs of using the API versus developing the functionality from scratch. Or, as is often the case in the API economy, the developer can seek out a more economical provider of a similar service.

Conclusion

This idea of sharing a common infrastructure across your customers is called multi-tenancy.

80262875323ecc7475a6fe75210155c6a6340721

results matching ""

    No results matching ""