The tag has no usage guidance.

learn more… | top users | synonyms

45
votes
6answers
3k views

Refactoring into lots of methods - is this considered clean or not? [duplicate]

So, I watched as my colleague complained a bit about a project he has inherited from someone who is, shall we say, not very experienced as a programmer (intern left to his own devices on a project). ...
10
votes
4answers
459 views

Where does “method” as a special term in OOP originate?

"Method" is a special term in Object-Oriented Programming. Does anyone know when the word began to be used in this particular sense, and in connection with what programming language or other branch of ...
5
votes
5answers
339 views

Sending Whole Data Object As Argument Or Just Required Fields?

Let's say I have a class that just stores data: ClassData Field1 Field2 Field3 Now let's say I have a function that uses Field1 and Field2: public void DoStuff(string field1, string ...
4
votes
2answers
191 views

Does the single responsibility principal promote flexibility?

Does the single responsibility principal promote flexibility? If not what are the other methods to make your classes more flexible? By flexibility I mean, a class is able to function correctly at any ...
10
votes
2answers
799 views

Design: Object method vs separate class's method which takes Object as parameter?

For example, is it better to do: Pdf pdf = new Pdf(); pdf.Print(); or: Pdf pdf = new Pdf(); PdfPrinter printer = new PdfPrinter(); printer.Print(pdf); Another example: Country m = new ...
5
votes
4answers
1k views

What is a good pattern for combined caching and reinitialization?

I have a situation where I have three requirements: Lazy initialization - don't create the collection until asked for it Caching - keep the collection in memory on the object Reinitialization - be ...
9
votes
5answers
6k views

Differences between messages and methods?

In Objective C you have the concept of sending messages to other objects, and, well this is very similar to method calling in languages like C# and Java. But what exactly are the subtle ...