Categories
Sin categoría

Mastery 09 – Classes to Code

If you already did the design and draw a class diagram in UML then you’ve already done the hard part. Now you have to follow what you diagram says.

Attributes

I can use the class diagram that I did for my mid-partial project for my Object Oriented Programming course. At the top we have the attributes of the class Contacto. To turn this into code you have to pay attention to the sign (this will be the acces type) and type variable. If there’s a minus sign you make the attribute private. If there’s a plus sign you make the attribute public. Then you just make it a String if it says that your attribute is a string.

Methods

The acces type rule still holds here so there’s no need to explain it again. What you have to look for is the values the method recieves and the return type. For java these things really matter but for languages like python or javascript it is not that important.

Relationships

Image result for relationships OOP
© wikipedia.com

You need to pay attention to the relationship between you classes becuase it directly affects the code. With inheritance you need to specify which class it extends from (if you’re in java). There are also composition and aggregation relationships, when there’s such a relationship you’ll need to create another attribute to the class.

Now, which programming language?

Mobile apps

Native

IOS – Swift

Android – Kotlin or Java

Hybrid – which Framework

React – Javascript

Vue, Angular – Typescript

Flutter – Dart

Back-end web development

Ruby

Javascript

PHP

Python

Server side application

Rust

Go

Games

For consoles

C++/C# along with the unreal framework

For desktop

C# along with the unity framework

Data Science/Machine Learning

Python

R

To create a static website

HTML CSS

Web app

Javascript

References

https://www.27global.com/how-to-choose-a-programming-language/

From Models to code with no mysterious gaps – interview with Leon Starr

Leave a comment