From the course: Programming Foundations: Object-Oriented Design

Unlock the full course today

Join today to access over 22,600 courses taught by industry experts or purchase this course individually.

Converting class diagrams into code

Converting class diagrams into code - Python Tutorial

From the course: Programming Foundations: Object-Oriented Design

Start my 1-month free trial

Converting class diagrams into code

- Olivia, so far we've looked at all the ideas and concepts of object orientation, but at the end of the day all of this design work we're doing will need to be converted into a programming language. So, can we start looking at code yet? - Yes, Barron. It's code time. - Finally! There are lots of different object oriented languages to choose from and each has their own unique way of doing things. So we want to show you that the high level concepts we've been discussing here work across languages, even though the implementation details, like syntax, will be different. To demonstrate that, I've simplified the spaceship class to only have two attributes, a public call sign, which is a string and a private integer to represent its shield strength. And it has two methods that are both public, fire missile, which returns a string and reduce shield, which returns nothing or at least that's what this class diagram says, but it does take an integer as input. So, to turn this into Java code, we…

Contents