Reading-Notes

Object-Orientated Programming, HTML Tables

This topic is important to me because I want to be flexible with my skill list, and from my knowledge OOP is important.

References

https://github.com/codefellows/domain_modeling#domain-modeling. https://developer.mozilla.org/en-US/docs/Learn/HTML/Tables/Basics. https://developer.mozilla.org/en-US/docs/Learn/JavaScript/Objects/Basics#introducing_constructors. https://ui.dev/beginners-guide-to-javascript-prototype. https://developer.mozilla.org/en-US/docs/Learn/HTML/Tables/Advanced.

Domain Modeling

Domain Modeling - the process of creating a conceptual model in code for a specific problem.

Why? This is important to get a better understanding of the problem you’re solving, and that you’re building a system that meets the requirments of the problem. (Helps identify potential issues!).

It describes the various entities, attributes, and behaviors.

An Object-Oriented model is an entity that stores data in properties and encapsulates behaviors in methods.

A constructor function is used to help when calling the function, it creates an object with the specified properties.

the new keyword instantiates an object.

the constructor function initializes properties inside that object using the this varibale.

The Math.random() function allows you to generate random numbers.

Methods can be added to constructor functions prototype.

A prototype is a blueprint that serves for other objects.

Every object in JS has a prototype, and the prototype object defines a set of properties and methods that are inherited by the object.

You can share methods and properties between objects!

Less memory load!

Domain Modeling Questions

  1. Domain Modeling is needed because it helps share properties between newly made objects.

HTML table basics

A table is a structured set of data made up of rows and columns.

Create a table with the table tag.

Use the td tag to contain cells.

the tr tag is used to contain each on one row.

HTML Table Basics Questions

  1. Reduces accessibility, not automatically responsive.
  2. Table, thead, tr.

Introducing Constructors

Object literals are fine when creating one object, but for more than one we use Constructors.

When you call a constructor it will create a new object, bind this to the new obj,run the code in the construc. and return the new obj.

Contructor Questions

  1. Its a function that creates properties and methods as a template which you can create objects with, lets you create multiple obj.

  2. In object literals ‘this’ is for the object being defined, and for constructors its for the object being created.

Object Prototype Using A Constructor

  1. If I was training under someone at my job at target, they would pass their skills onto me and I would also learn skills myself which makes me unique myself.

Things I want to know more about

I want to know more about inheritance. I want to understand and be able to use constructors consistently in my programs. I want to be able to understand OOP.