Most of methods are related to some kind of data retrieval. Naturally, what is the point to ask someone to do something and do not get result. Some people name lengthy data retrieval operations like: List findSomething() or List searchSomething() or ... there are quite few versions.
What I do is I just name them getSomething(). It does not matter if it is 1 or 15 lines of code. It does not matter if it works 0.1 sec or 5 mins. So my code consists of 80% of getters. Which are not normal getters that return reference to of class field. They are logic, they are code behind the application.
If programmer follows the first model, it's easier to spot for the caller which method will run faster and which may be slow. I.e. find should take less time than get. Also by properly naming method you may imply implementation details. In my case, the caller does not care how long it takes. Because the method name does explain the implementation details. I can change the method implementation anytime and I will not have to change find to get etc.
I am more seeing first model , than a second one. I am sometimes scared myself how many "getters" I have! But it works... And it works nice with JSP and Struts too. So how do you name your methods? And why?
getSomething() is fine for getters. In fact it's a standard for Java Beans and a lot of IDEs can generate the code for you.
Frameworks are full of these beans because standardized getters and setters are easy to automate. The beans we use for Data Transfer Object pattern and other Java Bean patterns are very common but they are not the whole world.
The problem is that when we can we like objects to hide their data. For "rich object models" with "good" domain objects, we focus on behavior. One guideline is "tell, don't ask" meaning tell an object what to do rather than getting the data and doing the work yourself. Knight's Principles lay this idea out in easy and entertaining terms.
Does the difference between data transfer objects in frameworks and rich domain objects make sense to you?
A good question is never answered. It is not a bolt to be tightened into place but a seed to be planted and to bear more seed toward the hope of greening the landscape of the idea. John Ciardi