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 - Python Tutorial
From the course: Programming Foundations: Object-Oriented Design
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
-
-
-
-
-
-
-
(Locked)
Creating class diagrams: Attributes2m 24s
-
(Locked)
Creating class diagrams: Behaviors3m 9s
-
(Locked)
Converting class diagrams into code4m 29s
-
(Locked)
Instantiating classes3m 39s
-
(Locked)
Class with multiple constructors2m 29s
-
(Locked)
Static attributes and methods4m 19s
-
(Locked)
Challenge: Jukebox class diagrams1m 21s
-
(Locked)
Solution: Jukebox class diagrams5m 8s
-
(Locked)
-
-
-