Quantcast
Browsing latest articles
Browse All 12 View Live

Why public access level method get overridden in java?

This question is raised with a clarification required to decide when to declare a method protected or public during class design of a package. My point is, if one needs to override a method of a...

View Article


Image may be NSFW.
Clik here to view.

Getters and Setters unclear example

I know autmatic getters and setters are considers bad as they tend to break object’s encapsulation. They also move the work that should have been done within the object outside. Allen Holub is a big...

View Article


How to encapsulate code in SharePoint 2010 and make it accessible across...

Anyone know the best way to reference a class to be used for any/all all solutions (web parts, application pages, timer jobs, etc)? I have several small modules of code that I’ve copied to multiple...

View Article

How can I use the “Non-Member Functions Improve Encapsulation” pattern from C#?

In 2000, Scott Meyers argued that non-member functions improve encapsulation. In C++, a non-member function is a C-style global function:...

View Article

Why am I getting field visibility warnings in Sonar?

Some static analysis tools flag non-private fields with Variable ‘[nameHere]‘ must be private and have accessor methods. Sonar consistently presents such warnings and wants to change all protected...

View Article


Query on hiding implementation details in java

With the below piece of thread related code, I see that author of Thread class is hiding the details about the working of start() method. What a user of Thread class need to know is, class Thread would...

View Article

How much to encapsulate when objects being dealt with are pretty similar

As I have been answering questions related to object-oriented design and how to go about reducing the amount of classes to make sure that there is not a lot of “class clutter” and code repetition I...

View Article

Can “higher order function” feature allow/maintain abstraction and...

Below is the function repeat written using a functional paradigm, such that when called as repeat(square, 2)(5) it will apply the square function 2 times on the number 5, something like...

View Article


TDD Red-Green-Refactor and if/how to test methods that become private

as far as I understand it, most people seem to agree that private methods should not be tested directly, but rather through whatever public methods call them. I can see their point, but I have some...

View Article


Should methods perform checks that they accomplished the task they were built...

What are some pro’s and con’s of validating your performed the task intended? public static bool UploadFile(string filename) { // 1. upload the file // 2. check to see if the file now exist on the...

View Article
Browsing latest articles
Browse All 12 View Live