Giter Club home page Giter Club logo

halloween-tower-defense's People

Contributors

ali92hm avatar

Watchers

 avatar  avatar

halloween-tower-defense's Issues

ISP violation correction SOLID

Hello, ive read youre code and found an ISP violartion, and fixed it.
TD button
Before:
image
image
image

The TDButton class doesnt need mouseReleased, mousePressed y mouseClicked methiods from the interface MouseListener of Java.

After:
image
image
image

Extract Class Refactoring

Hello,

I have reviewed your project and I found the communication in your classes interesting. One of those classes is DriverModels where it has some responsibilities and is very extensive which is a code smells. But the main problem is having variables of different responsibilities within the class, I attach an image of the class diagram of the mentioned class

extractClass bf

As you can see, you have many methods and many attributes. One of my solutions is to move the data as life and money to a new class called DataGame, which is in charge of handling that, plus the logic of increasing or decreasing money. I attach an image of the class diagram of the mentioned class
extractClass af

Move Method Refactoring

Hello again,

Reviewing the attached class above it is still very extensive, so we have to decrease it more because internally it still has many responsibilities that do not correspond to it, which were not completely eliminated with the previous refactoring, because of this we will use another refactoring to decrease it again , I attach an image of the class diagram of the mentioned class.

extractClass af

As I mentioned earlier, the best option is to use another refactoring, this is where the utility class that it has with a single method comes in, to give it more use, we give it the methods that stopped a thread or started it, so that any graphic class can do it.

moveMt af

Thanks for the attention friend.

OCP Violation + Solution

Hello there.

I noticed your code has some problems about SOLID principles, so I made a report about how you can improve it along with the parts where it happens. Hope this helps you to improve!

Have a nice day!
OCP - How to Improve.docx

Move Filds refactoring

Hello one more time,

Reviewing the previously attached class it is still a bit long, so we have to decrease it a little more because internally it has attributes that do not correspond to it, despite all the refactoring used, because of this we will use a last refactoring to Totally decrease the class, I attach an image of the class diagram of the mentioned class.
moveMt af
As mentioned above, the best option is to use a last refactoring, reviewing the classes that it has, note that it has the Driver and MapData class that already have the same attributes or similar responsibility so we will give it the corresponding artributes, it is for these reasons that we could use the move Filds refactoring, so as not to have code redundancy.
moveFl af

Thanks for all the attention and patience.

Substitute Algorithm Refactoring

Hello,

Looking through your classes I found a method called that I think the best you can do is to Substitute your Algorithm because it has Code Smells like Long Method, Message Chain, Duplicate Code. But, I could notice that the main problem is the way that it was coded. So, using Refactoring Techniques I brought an option that you could implement in your code.
So this is the method that I was analizing:
image
image

As you can see you have a very long method and duplicated code for each if statement you make.
Also you can see a lot of Message Chain in this method A -> B -> C

And this was the solution I propose:
image
The benefits for implementing this solution is that you no longer have a long method, your method is 10 lines long, which is accepted. Also you can see that there is no Message Chain, and this was solved by implemented some methods in the DriverView class. Making this also minimizes the coupling you had in your method.

Hope that I could help,

Have a nice one.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.