Code Monkey home page Code Monkey logo

encapsulation's Introduction

Module: Encapsulation

"Encapsulation is one of the fundamentals of OOP (object-oriented programming). It refers to the bundling of data with the methods that operate on that data. "

Overview


Module Summary

Encapsulation is the idea of grouping together your data with the functions that use it. That's it! (for now :) There are many ways to achieve this, but the end result is code that is easier to understand and nicer work with.

Heads up! In this module you'll be encountering some of the most important (and most challenging!) aspects of the JavaScript language this, inheritance & classes. These are all features of JS that allow you to encapsulate functions & data for readable, reusable code.

Along the way you will get your first introduction to one of the main programming paradigms in JS: object oriented. At their simplest level, programming paradigms are just different answers to the same question "How will I group my data and my functions?".

TOP


Learning Objectives

Programming Skills

  • Object Oriented Programming
    • Refactor projects from last module into OOP projects
  • Data-first development
    • Understanding applications as Data + User Interactions
    • Developing from the "inside" out: Writing the core object before the user interface
    • Explain what a schema is and why it's useful (PS. it's like tests, but for data!)
    • Use the JSON schema specification to document your program's data
    • Use a schema validation library to grantee the integrity of your project's data
  • Debugging:
    • Bugs are when you don't understand what your code is doing, not when your code doesn't understand what you want it to do! The computer is always right :)
    • Stepping through your programs with the Browser and Node.js debuggers
    • Using the debugger, console.assert, assert (in Node) and breakpoints for native debugging
    • Refactoring & testing segments of code you don't understand / are not working
  • Understand Behavior vs. Implementation
    • Behavior: The test cases that a function does and doesn't pass. What the function does.
    • Implementation: The actual lines of code written. How memory is manipulated so that the behavior happens.
  • Testing
    • Learn to predict what will happen instead of describing what did happen
    • Testing each step of your project before moving on
    • Using the native Node.js module assert
    • Writing & using popular testing libraries (jasmine & mocha)

Isolating JavaScript (study JS outside of applications)

  • Understand this
    • Be able to refactor functions into methods
    • Be able to refactor methods into functions
    • Plan and implement objects based on User Stories
  • Understand getters and setters
  • Understand the class keyword
    • Be able to refactor between constructor functions & classes
    • Use classes to create simple programs

Integrating JavaScript (JS embedded in applications)

  • Understanding your projects as being first an object, and second a user interface
    1. Object: what data is stored in your application, and how can users interact with it? (Data & Logic)
    2. User Interface: what does a user see on the screen? (styles & DOM)
    3. User Interactions: how does the user interface connect with the core object? (listeners & handlers)
  • DOM Components
    • Create functions and methods that return DOM elements
    • Reuse the same components in different places on your site

TOP



Hack Your Future: Belgium

encapsulation's People

Contributors

colevanderswands avatar bramdevries avatar

Watchers

James Cloos avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.