Tag Info

Hot answers tagged

2

Sounds like you are not very good just yet with the responsibility assignment in programming. Have a look at General Responsibility Assignment Software Patterns. They will tell you exactly where to place each method and property. You want to have a class that defines an object with it's own properties and methods to act upon it. You don't want to just ...


2

That's not a quirk of your IDE - that's part of the Java Beans convention. There are many other Java tools and libraries(ORMs, serializers, configuration readers etc.) that rely on these conventions and will not work(or work poorly) if you disobey them. That being said - getters should not always be restricted to physical fields. If you have a class Circle ...


1

Your concerns are valid. You're using a strongly typed language, yet venturing into a weakly-typed or untyped area. It happens, but this kind of error/constraint checking you're asking about (if nicely addressed) will increase maintainability by returning you to the benefits of being more strongly typed. What I would probably do is analyze the template to ...


1

It depends. If there is some code above this that effectively enforces that the right variables are sent in (some form for example), then this is unlikely to break frequently, so making each message its own type seems like overkill. If there is not some code above this and you're relying on your programmer's goodwill to make sure that stuff is well ...


1

Your way of thinking is perfectly reasonable. I guess, the biggest question is should I even bother doing the refactoring (from a purely practical point of view)? That depends. From the artist's standpoint, the answer is YES. But there is money involved. So, you must estimate the impact of unrefactored code to your development cycle. If it will cause ...


1

If you want to keep the abstract class and your language supports generics you may need to use a generic upperbound. Then the C1 can be parametrized with A and vice versa. Further down the line, different methods are expecting to be able to call methods that belong to different descendants of A and B. Maybe you can define here these operations as ...



Only top voted, non community-wiki answers of a minimum length are eligible