Why we need to know about the Application framework fundamentals and coding standard with OOP concept !!

Rasitharoshana
8 min readFeb 26, 2022

developing software production is difficult task since all the things are handled by developer.It is must have good coding stand so, here we going to talk about the way enhance the coding stand and How we have attach oop concept to development of the coding stand

As well as here are going to talk about the JavaScript language.

Approaching the solution

To approach the problems for software based production is very difficult task since there more thing to consider when have a solution.In order to have solution first we have to consider about the problems which arise with scenario.When we get the root of the problem we can have best solution .There are some standard step to follow in order to come up with a best solution.

1. Think throughout the problem

●Before approaching the solution or even before starting to think about the problem think through the problem.Make sure you understand the problem that you are going to resolve, completely.If we start with the solution without consider about the problems it may case to big problems.

2. Divide and conquer

After understating about the problem well we can divide the problems in some orders parts with good understanding

Then we can manage sub problems to have a solution best way.

3.KISS

Do not overthink or over engineer.

4. Learn from the mistakes

Always we have to expect the changes.so we can take decision by learn from the the mistakes.mistakes are the best encourage for the success.

So, It is must go ahead with learning from the mistake.

Implementing the solution

1. YAGNI

Do write code that isn’t useful right now but you believe will be useful in the future.The future is continually changing.This is a complete waste of time.
Write only the code you require for the time being.

2.DRY

Always reuse code you wrote.Code as best as possible and keep it generalize and reusable.

3.Embrace abstraction

Make sure your system works properly even if you don’t know the implementation specifics of each component portion.The user class should be able to authenticate a user without knowing where to obtain the user’s username and password.

4.DRITW

Someone else might have already solved the same problem.Make use of that.

5.Write code that does one thing well

Single piece of code that do one thing and that one thing really well.Do not try to write the magic code that does it all….

6.Debugging is harder than writing code

Make it readable as possible.Readable code is better than compact code.

7.Kaizen

Fix not just the bug but the code around it.Band-aid bugfix won’t help if the real problem is a design problem

Object Oriented Programming

oop is a one of the best concept which going with programming languages including Java, C++, Python and JavaScript. It relies on the concept of classes and objects.

Many concept have been invented using this oop concept .Those concept much more important for programming because enhance the coding standard and reduce the complexity of the programming.

  1. Polymorphism
  2. encapsulation
  3. Information Hiding
  4. Inheritance
  5. Abstraction

are the some of the very important concept which going with oop concept.

S.O.L.I.D

S.O.L.I.D are 5 object oriented principles that should be followed when designing software

1.Single responsibility

As the name implies, this concept argues that each class should have a single responsibility and a single goal.This implies that a class will only perform one function, implying that it should have only one reason to change.

Although this appears to be acceptable, it is not a good example of the SRP.
We have two tasks here: altering the text and printing it.

The presence of a method in this class that prints text violates the Single Responsibility Principle.
To accomplish this, we should construct a new class that will just handle text printing:

2.Liskov substitution principle

It states that a superclass object should be replaceable with a subclass object without affecting the software’s functioning.It is a sort of behavioral subtyping defined by semantic design considerations rather than syntactic considerations.

The object-oriented design abstraction ideas of inheritance and polymorphism enable the Liskov Substitution Principle.These are frequently accomplished as subclassing of superclass objects through the use of abstract data types such as interfaces that define common behavior.

sample code for LSP.

3.Open/close principle

Consider a method that only does one thing to exemplify this principle.
Assume it writes to a certain file whose name is hard-coded within the procedure.
If the requirements change and the filename needs to be changed in particular cases, we must open the mechanism for changing the filename.
If, on the other hand, the filename had been passed in as a parameter, we would be able to change the behavior of this method without changing its source, keeping it closed to change.

The Open-Closed Principle can also be done in a variety of other ways, such as through inheritance or compositional design patterns such as the Strategy pattern.

4.Interface segregation principle

This idea was coined by Robert C. Martin, who stated, “Clients should not be forced to rely on interfaces that they do not use.”

This principle’s purpose is to reduce the adverse effects of employing larger interfaces by splitting them down into smaller ones.
It’s comparable to the SRP in that each class or interface has a single purpose.

sample code:

5.Dependency inversion principle

According to the Dependency Inversion Principle (DIP), high level modules should not rely on low level modules; instead, both should rely on abstractions.

When building software, it is highly typical to implement it in such a way that each module or method directly refers to its collaborators, which accomplishes the same thing.

— —-Java Script — — —

JavaScript was originally designed to “bring web pages to life.”

Scripts are the name given to programs written in this language.
They can be written directly in the HTML of a web page and run immediately as the page loads.

Scripts are provided in plain text and executed as such.
They don’t require any extra setup or compilation to execute.

In this regard, JavaScript differs significantly from another language known as Java.

JavaScript supports both OOP and functional programming (Multi-paradigm).

JavaScript’s asynchronous operations are managed by an eventing system.

Why is it called JavaScript?

When JavaScript was first developed, it was known as “LiveScript.”
However, because Java was so popular at the time, it was felt that promoting a new language as a “younger brother” of Java would be beneficial.

However, as time passed, JavaScript evolved into a completely different language with its own specification known as ECMAScript, and it currently has no resemblance to Java at all.

JavaScript Prototypes

Because JavaScript is a prototype-based language, one of the most fundamental topics for JavaScript practitioners to comprehend is the prototype object.

JavaScript functions contain a reference to another object known as the prototype.It’s comparable to how classes are defined in other languages.
It is, in fact, another instance of an object.A prototype object is used in JavaScript for generating objects, inheriting objects, and adding methods to a JavaScript class.

Because of the flexibility of JavaScript, there are numerous ways to build and expand classes.Prototypes are the suggested method.A constructor function is a function that is used to build things.The prototype of an object instance is the object instance from which the object is constructed.Object ‘__proto__’ is where properties are inherited from.The prototype of a function is used to pass properties to object instances.

— — This key word in JavaScript — —

Unlikely other languages in JavaScript ‘this’ keyword acts differently.Inside a object ‘this’ refers to object itself.In global context ‘this’ refers to global object (in browser it is the window object).

This behaviour will get changed in strict mode.If a function which is using ‘this’ keyword is being passed to another object then ‘this’ will refers to that object, but not to the original object where function was declared at first place.This behaviour is very noticeable in callback and closures.

sample code for this keyword

Strict notation

JavaScript in Restricted mode.Its purpose is to make writing safe JavaScript easier.Strict mode causes JavaScript errors due to improper practices.Keep developers away from syntaxes that will be rendered obsolete by future JavaScript advances.

uses of strict mode

1.Strict mode converts some JavaScript silent mistakes to throw errors, which eliminates them.

2.Strict mode corrects errors that make it harder for JavaScript engines to optimize: strict mode code can sometimes be managed to run quicker than similar non-strict mode code.

3.Strict mode forbids the use of some syntax that is likely to be defined in future editions of ECMAScript.

4.When comparably “unsafe” actions are taken, it prevents or throws errors (such as gaining access to the global object).

5.It disables features that are unclear or poorly designed.

6.Strict mode facilitates the creation of “secure” JavaScript.

— -Callback and promises of javaScript — -

A ‘callback hell’ is a sequence of async jobs with nested callbacks.To address this issue, the Promise object was established.To handle complex async activities nicely, the Promise object provides a set of properties, methods, and a chaining mechanism.

Key Difference Between Callbacks and Promises

When employing the callback strategy, we’d generally just send a callback into a function that would then be invoked upon completion in order to retrieve the outcome of something.
In promises, however, callbacks are attached to the returned promise object.

--

--