[refactoring] remove generic type where not needed
Moderators: North, BetaSteward, noxx, jeffwadsworth, JayDi, TheElk801, LevelX, CCGHQ Admins
[refactoring] remove generic type where not needed
by North » 31 May 2014, 13:08
I propose to remove the generic type definition from the MAGE framework (MageObjectImpl, AbilityImpl, Effect ...). As I can see, it is only used for the copy method. This one does not need to be more specific then the base abstraction. It is something that does not bring any value whatsoever but is more of a hindrance for the developers.
If there are any reasons to keep the generic types please let me know. The only one I can think of is the fact that it will be a bit of work to remove them.
If there are any reasons to keep the generic types please let me know. The only one I can think of is the fact that it will be a bit of work to remove them.
Re: [refactoring] remove generic type where not needed
by North » 31 May 2014, 16:15
I went on ahead and did the refactoring for the Counter class. Because I was in the area I went on ahead to fix more than this and increase the consistency when using counters.
Re: [refactoring] remove generic type where not needed
by North » 03 Jun 2014, 14:24
I think I finished removing the generic type for all the classes. The ones that implement some kind of Collection kept their generic types but those aren't used anywhere outside the framework core.
I think that the code became a bit easier on the eyes. Also, one doesn't have to decide what the generic parameter to use since they're no longer required.
The only thing that one should watch out for is the copy method implementation. It should always return a new instance of the object being copied.
I think that the code became a bit easier on the eyes. Also, one doesn't have to decide what the generic parameter to use since they're no longer required.
The only thing that one should watch out for is the copy method implementation. It should always return a new instance of the object being copied.
Re: [refactoring] remove generic type where not needed
by jeffwadsworth » 04 Jun 2014, 20:28
Thanks for doing this. It is so much easier to read the code now. Now if only the Forge crew would do the same for that JavaDoc stuff.
- jeffwadsworth
- Super Tester Elite
- Posts: 1171
- Joined: 20 Oct 2010, 04:47
- Location: USA
- Has thanked: 287 times
- Been thanked: 69 times
Re: [refactoring] remove generic type where not needed
by North » 04 Jun 2014, 21:02
Thank you for the great feedback. I'm glad to hear my changes do make a difference.
5 posts
• Page 1 of 1
Who is online
Users browsing this forum: No registered users and 6 guests