---
title: "Discussion on \"Object-Oriented Programming Principles in Dart\" | Hashnode"
description: "Discussion on \"Object-Oriented Programming Principles in Dart\". In this article, I want to describe the Object-Oriented Programming and its four principles using examples written in Dart. The concepts are valid in any object-oriented programming language but here we will focus on their implementation in Dart. You..."
url: "https://hashnode.com/posts/object-oriented-programming-principles-in-dart/5f756db89e97481f10770371"
---

[Feed](https://hashnode.com/feed) /

Discussion

# [Object-Oriented Programming Principles in Dart](https://blog.albertobonacina.com/object-oriented-programming-principles-in-dart?utm_source=hashnode&utm_medium=feed)

In this article, I want to describe the Object-Oriented Programming and its four principles using examples written in Dart. The concepts are valid in any object-oriented programming language but here we will focus on their implementation in Dart. You...

Oct 1, 2020 · 12 min read · blog.albertobonacina.com  
Updated Nov 26, 2020  
Read the article

-   [#dart](https://hashnode.com/tag/dart)
-   [#software-development](https://hashnode.com/tag/software-development)
-   [#software](https://hashnode.com/tag/software)
-   [#programming-languages](https://hashnode.com/tag/programming-languages)
-   [#programming](https://hashnode.com/tag/programming)

## Written by

[Alberto Bonacina](https://hashnode.com/@polilluminato)

@polilluminato · Bergamo, IT

  
[View profile](https://hashnode.com/@polilluminato)

Proud Software Engineer, Flutter enthusiast and Free Software activist

I love programming and I work as a Software Engineer developing web based applications and mobile apps. I'm a full stack developer, from the backend where I primarly use Node.js and MySQL on Linux Servers to the frontend where I use modern web technologies and CSS frameworks. I love to develop mobile app, especially in Android mainly in Java, and in the last year I'm using Flutter, first to experiment and in the last period to develop cross platform enterprise apps. In my spare time I like to experiment on side projects apps, ui designs, web app to improve my skills and test new ideas.

## Responses 1

Markdown supported · ⌘↵ to post

[Diego Carvalho](https://hashnode.com/@Caballero75)

[Oct 3, 2020](https://hashnode.com/posts/object-oriented-programming-principles-in-dart/5f756db89e97481f10770371/comment/5f78d85b7d160d41227d7bd6)

Good article. I have a question. Why have you used 'this.' in front of properties on Animal class and not on Human class? Thanks

[Alberto Bonacina](https://hashnode.com/@polilluminato)

[Oct 5, 2020](https://hashnode.com/posts/object-oriented-programming-principles-in-dart/5f756db89e97481f10770371/comment/5f78d85b7d160d41227d7bd6#reply-5f7ab6827d160d41227d8df1)

Because I forgot it. To be precise, the 'this' keyword would only be needed in cases where the input variable and the local variable have the same name, and by using the 'this' keyword one can distinguish the local variable from the one passed as a parameter.

void setWeight(double age){ this.age = age; }

In which the assignment of the value of age is given to the local variable this.age. In the examples, I have reported there is no such problem because the local variable and the one passed as a parameter do not have the same name, so you can remove 'this' in all the code, and everything would still work correctly.
