I am often implementing a class that keeps myself as an enum form of some sort : I have a position value and a situation. How can I resolve the conflict of this type of property?
public class car {public sector status {closed, starting, running}; Position status = position. Off; Public status status // & lt; ===== will not be compiled ===== {return status; } Set {status = value; do something(); }}}
If the status enum was common for different types, then I would keep it out of the classroom and the problem would be solved.
Which naming conventions do you engage in this matter?
NB: In response to this question was partly debated in the comments. Since it was not the main question, it did not get much visibility.
EDIT: Philip Eckberg has suggested an IMO excellent refinement for the specific case of 'condition'. Yet I would be interesting to read about the solutions where the name of the name / property is different, as Michael Priveki's answer .
EDIT2 (May 2010): My favorite solution is to pluralize the name of the ANIM type, as suggested by Chris S. According to the guidelines of MS, it should be used only for flag annihilation. But I have loved it more than I regularly use it for energy.
I will add 1 euro to the discussion but this is probably not adding anything new.
The obvious solution is to move the position of having a nested enum. Most .NET enums (except for some possibly in the Windows.Forms namespace) are not nested, and this is for developers who prefix the classname to your API Uses trouble in using
One thing that has not been mentioned is that according to the guidelines of the MSDN, there should be a flag emom, which you probably already know (the situation is a simple anem , Therefore singular nouns should be used).
The state (enum states states)) is vocal, "status" is a noun only that most languages of our language are absorbed from Latin. Vocative is what you call a noun for your situation and is a matter of nominal action.
In other words, when the car runs , that is the verb - its position is its position but the car does not go, its engine does not, nor does it start, The engine does (you probably picked an example here, so it can be irrelevant).
public class carriage {location of vehicle _webicstate = vehicle station. Public Vehicle Station Vehicle Station {Back {return_vehicleState; } Set {_vehicleState = value; do something();
The state is such a generalized noun, it would not be better to describe what state it is mentioning? Like I did upwardly
In my opinion, the type of type does not refer to the reader type, but its database I like it if you were describing the database product of the reader which is the type of reader (For example, the type of reader can only be forwarded, cached, and so on) then
reader.database = database. Oracle; This is never really done in reality, because instead of using energy it is implemented as drivers and heritage series, this is the reason that the above line does not look natural.
Comments
Post a Comment