STIC I

Interactive Applications with JavaScript II

Re-usable elements

Reminder: course perspective

JavaScript between Computational Thinking and Interaction

Reminder: "digital intentions"

Transformation I/O

Reminder: programming core

Programming summary

Ideal development...

The purpose of development is to create something useful, meaningful, fun, ... that fulfills a need, solve a problem or improve a situation for users/learners.

Developers spend time creating things!

Repartition of time in development

Show as or

Ways to maximize creation time

  1. Use tools (Editor, Authoring Tools, GitHub, ...)
  2. Adopt best practices (style guides, ...)
  3. Follow development methodology (e.g. ERGO)
  4. Build an application architecture (Master thesis)
  5. Use re-usable code (frameworks, libraries, plug-ins)

Application architecture (advanced)

Example of application architecture

See the application to compare...

Reusable code/elements

They can be used on all the components of a page/app

Definition

A JavaScript framework, library or plugin is a JavaScript file (or more) that provides the developers with pre-built elements to develop their own application.

How does it work

File(s) are incorporated into the HTML of the page via the <script> tag.
  1. Downloading the file(s) from the official site or GitHub
  2. Using a Content Delivery Network (CDN). The file(s) are hosted in the cloud.

Download the file(s)

Download the file(s)

The order of the files is often very important!

Using a Content Delivery Network

Use a CDN

See for example CDNjs.com

Different re-usable intentions

Reusable code funnel

How to choose a library

  • Define in advance:
    • The objectives of the application
    • The size/complexity of the project
  • Be aware of:
    • The available documentation
    • Who is behind and supports the project
    • The environment (front- or back-end)
    • The license and limitations of use

Choose from JavaScripting.com

Criterion Response
Name and Developer Who created and maintains it?
Objective/Fonction What does it do?
License type [MIT, CC, ...] -> what is it?
Doc/Support [none, minimal, good, ...]
Dependencies Other file(s) needed? CSS, ...
Current version stable or beta or alpha