LPOO :: 2018/19 1st Semester

Report Template

LPOO_<T><G> - <project name>

Include here one or two paragraphs explaining the main idea of the project, followed by a sentence identifying who the authors are.

Example:

In this exciting platform game you can help KangarooBoy save the world, by collecting all the coins throughout ten different levels in which you will […].

This project was developed by John Doe (john.doe@fe.up.pt) and Jane Doe (jane.doe@fe.up.pt) for LPOO 201819.

Implemented Features

This section should contain a list of implemented features and their descriptions. In the end of the section, include two or three screenshots that illustrate the most important features.

Examples:

Planned Features

This section is similar to the previous one but should list the features that are not yet implemented. Instead of screenshots you should include GUI mock-ups for the planned features.

Design

This section should be organized in different subsections, each describing a different design problem that you had to solve during the project. Each subsection should be organized in four different parts:

Example of one of such subsections:


The jump action of the KangarooBoy should behave differently depending on its state

Problem in Context

There was a lot of scattered conditional logic when deciding how the KangarooBoy should behave when jumping, as the jumps should be different depending on the items that came to his possession during the game (an helix will alow him to fly, driking a potion will allow him to jump double the height, etc.). This is a violation of the Single Responsability Principle. We could concentrate all the conditional logic in the same method to circumscribe the issue to that one method but the Single Responsability Principle would still be violated.

The Pattern

We have applied the State pattern. This pattern allows you to represent different states with different subclasses. We can switch to a different state of the application by switching to another implementation (i.e., another subclass). This pattern allowed to address the identified problems because […].

Implementation

The following figure shows how the pattern’s roles were mapped to the application classes.

These classes can be found in the following files:

Consequences

The use of the State Pattern in the current design allows the following benefits:

Known Code Smells and Refactoring Suggestions

This section should describe 3 to 5 different code smells that you have identified in your current implementation, and suggest ways in which the code could be refactored to eliminate them. Each smell and refactoring suggestions should be described in its own subsection.

Example of such a subsection:


Data Class

The PlatformSegment class is a Data Class, as it contains only fields, and no behavior. This is problematic because […].

A way to improve the code would be to move the isPlatformSegmentSolid() method to the PlatformSegment class, as this logic is purely concerned with the PlatformSegment class.

Self-evaluation

In this section describe how the work regarding the project was divided between the students. In the event that members of the group do not agree on a work distribution, the group should send an email to the teacher explaining the disagreement.

Example: