Use the first class to work on the exercises below. No hand-in is required.
Spend the first 15-20 minutes of the class in plenum discussing...
Blizzard's online card game 'Hearthstone' is played by two
players, and a central inspiration for the mandatory project
'HotStone'.
SWEA is rooted in the object-oriented programming paradigm: programs are made of interacting objects, that holds data (instance variables) and operations (methods) that "do things to that data".
Consider the visual elements in the above image and try to identify objects to model in our OO program. What data should the objects hold? What operations may be present?
Consider that "the game itself" is an object. What data must it hold? What operations must it support?
Try to draw (parts of) your understanding on the whiteboard, using UML class diagram notation.
When playing cards onto the battlefield, cards may trigger 'actions' or 'effects' which can change all sorts of state/data in the game's objects: add health to a hero or other card, draw a card to the hand, steal a card from the opponent's hand, kill all fielded opponent cards, etc. How can you model that?
"High cohesion and low coupling" is a mantra in programming. Discuss informally what these two concepts are; and discuss if 'low coupling' is possible when modeling the above mentioned card effects.
Important: The above questions are not to be "fully answered" but just to be reflected upon and left open with 'quite a few unanswered questions.'
Form groups of two (recommended) or three persons and enroll in one of the available groups on BrightSpace. If no free group is available, contact a TA or Henrik Bærbak and we will create one.
SWEA assumes some proficiency in programming in Java! So if you are a bit rusty, then start out by reading and coding the prerequisites with exercises that I have designed. If you master these small exercises, you have the skills that the SWEA course requires.
This course requires a lot of tools running on your machines and I provide two options for you. Either you use a pre-installed virtual Lubuntu Linux machine that has all tools; or you install the tool stack onto your machine by yourself. Either way, consult the Tools page for what to do.
gradle test
in the root folder of the project. It should output
something like
csdev@m33:~/proj/hotstone$ gradle test Starting a Gradle Daemon (subsequent builds will be faster) BUILD SUCCESSFUL in 879ms 4 actionable tasks: 4 executed
CoPilot and AI tools are great tools to increase development productivity. However, in a learning context, they may hinder your learning experience as they "spew out a lot of code": Are you in charge of CoPilot, or does CoPilot take charge of you? You should not use a tool that produces code that you do not have the ability to overview and understand.
Therefore, do not use AI generated code at least until after the Autumn break. You need to learn to master coding before you let AI generate code for you. In the late parts of the course, when CoPilot is a faster way of writing the code you could write yourself, it is OK to turn it on.
It is sadly a recurring reason for failing the SWEA exam, that students with too weak programming and coding experience, has relied too much on IntelliJ 'code completion' and 'intention action' support, and therefore are incapable of producing valid Java code at the exam. I fear AI tools may make this situation even worse. Avoid the trap, become a good programmer before turning on AI tools!
Several hand-ins will require delivering screencasts. If you have not made screencasts before, check out our group's ability to make such. Consult the Tools page that contains suggestions. If you have others, please report so on the web board, to get everyone going.
The course uses a concrete programming project, HotStone, to illustrate central concepts from course curriculum: test driven development, design patterns, compositional design, frameworks, systematic testing, and the Broker pattern for remote method calls.
The project, when finished, will be a framework for designing variants of a card playing game, quite a few simple variants, and one variant that is playable (and approaching 'fun to play'), and includes a functional graphical user interface and the ability to play over the internet.
If you have never played any card games like Blizzard Hearthstone, etc., I suggest that you "play around with them" a bit. Many of them are free games to try out.
I have made two videos (in Danish) about HotStone, demonstrating the user interface that you will work on in Iteration 8. If you already know HearthStone, then choose:
If you do not know Hearthstone, then pick this longer one:Another route is to play HotStone directly. You play with a friend using my game server (you will be alpha-tester of the system, so please report issues/defects/crashes on the SWEA forum). Find instructions on hotstone.littleworld.dk:5220. It is a bit tedious to start a game, sorry about that.
Start on the Iteration 1 exercises which is next weeks mandatory.