473,396 Members | 2,151 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

Help /w Method's naming best practice

I am just looking for some advice on naming my methods - I am getting
confused as to what some of them mean now

I have the following scenario - A Visual Data Object and a Logical Data
Object.

I wanted to make sure that there were calls that could be made to either for
things like Validate or InsertRow and that I could easily override and
inherit both objects.

The most cumbersome example is with Validation. I have a Validate data to
do the whole dataset as well as ValidateRow to do a specific row. I wanted
to be able to call the logic method which in turn fired the visual objects
event which in turn called a processing method on the logic.

So:

Logic.DataValidate -> Visual.OnDataValidate( )

Visual.OnDataValidate -> trigger Visual.DataValidate( )

Visual.DataValidate( ValidateEventArg )
{
try{
Logic.ValidateData(ValidateEventArg)
catch ...
}

Thus I seem to have three methods/events for each action I want to capture.
Plus I've got menu actions I'm trying to capture and its confusing it even
more. I've been flipping the names around using the verb/noun or noun/verb
to name the methods and I'm getting annoyed with it. Any suggestions would
be greatly appreciated!

thx

jack
Nov 16 '05 #1
1 1322
oj
The naming convention is fine to me. For methods, I would do <action><obj>.
For events, I would just add "On" to the method, <On><action><obj>.

--
-oj
"Jack Addington" <ja********@shaw.ca> wrote in message
news:en**************@TK2MSFTNGP15.phx.gbl...
I am just looking for some advice on naming my methods - I am getting
confused as to what some of them mean now

I have the following scenario - A Visual Data Object and a Logical Data
Object.

I wanted to make sure that there were calls that could be made to either
for things like Validate or InsertRow and that I could easily override and
inherit both objects.

The most cumbersome example is with Validation. I have a Validate data to
do the whole dataset as well as ValidateRow to do a specific row. I
wanted to be able to call the logic method which in turn fired the visual
objects event which in turn called a processing method on the logic.

So:

Logic.DataValidate -> Visual.OnDataValidate( )

Visual.OnDataValidate -> trigger Visual.DataValidate( )

Visual.DataValidate( ValidateEventArg )
{
try{
Logic.ValidateData(ValidateEventArg)
catch ...
}

Thus I seem to have three methods/events for each action I want to
capture. Plus I've got menu actions I'm trying to capture and its
confusing it even more. I've been flipping the names around using the
verb/noun or noun/verb to name the methods and I'm getting annoyed with
it. Any suggestions would be greatly appreciated!

thx

jack

Nov 16 '05 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

4
by: VK | last post by:
09/30/03 Phil Powell posted his "Radio buttons do not appear checked" question. This question led to a long discussion about the naming rules applying to variables, objects, methods and properties...
6
by: clintonG | last post by:
Microsoft recommends CompanyName.TechnologyName and it all comes down to not breaking the inheritence model if I am not mistaken. VSN2003 however tells the compiler to use the name of the project...
11
by: orekinbck | last post by:
Hi There What convention do you use when naming an enumeration and variables that use the enumeration? I like plural/singular, for example: public class Example { public enum VehicleTypes...
48
by: Robert Jacobson | last post by:
Hello all, If I have a class called "Foo," is there a preferred naming convention for iterating through each Foo instance in a collection of Foos? I've seen several different variations, even...
6
by: Greg | last post by:
Is this a good idea? From a brief dabble with MFC years ago, I understand that this is a worthy goal. Therefore I'm trying to remove most of the guts of an app from the main form code to...
114
by: Jonathan Wood | last post by:
I was just wondering what naming convention most of you use for class variables. Underscore, "m_" prefix, camel case, capitalized, etc? Has one style emerged as the most popular? Thanks for...
19
by: zzw8206262001 | last post by:
Hi,I find a way to make javescript more like c++ or pyhon There is the sample code: function Father(self) //every contructor may have "self" argument { self=self?self:this; ...
53
by: Hexman | last post by:
Hello All, I'd like your comments on the code below. The sub does exactly what I want it to do but I don't feel that it is solid as all. It seems like I'm using some VB6 code, .Net2003 code,...
23
by: Thorsten Kampe | last post by:
Okay, I hear you saying 'not another naming conventions thread'. I've read through Google and the 'naming conventions' threads were rather *spelling conventions* threads. I'm not interested...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.