pmMDA.NET is developed using the coding convention from bbv. The generated source code also fullfill these conventions.
As defined in the bbv code guidelines, member variables have the prefix m_
.
The reason therefore is that the properties would otherwise have the same name as the
member variables if the used language is case insensitive (like VB.NET).
And because pmMDA is CLS compatible, and therefore can be accessed from VB.NET, the class
variables have the prefix m_
.
Note that all class variables, not only the value holders for properties, have the prefix
m_
to avoid complex coding conventions.
The users of the pmMDA.NET framework will not notice the m_
prefix because
all class variables are private. But for developers of the pmMDA framework this fact is
important.
Interface names are not specified in the bbv coding guidelines.
In pmMDA.NET Interfaces names starts with an I (.NET standard).
In Java properties are simulated by get and set methods. The .NET Framework has a different implementation of the property concept. The properties in .NET are written with a special language construct (i.e. property in C#) and are accessed like normal variables.
.NET developers are used to the .NET property concept. Thus it makes sense that all get or set methods, which represents properties in the java pmMDA framework, are converted to .NET properties for the pmMDA.NET framework. The property name is the same as in the java pmMDA framework except that the get and set prefix is removed. For someone with excellent knowledge of the java pmMDA framework it is very easy to use the pmMDA.NET framework because he just has to omit the get or set prefix.
Another advantage of using .NET properties is that the data binding feature of the .NET framework can be used. TODO: stimmt so nicht ;)
This coding convention is used in the pmMDA.NET framework as well as in the .NET Cartridges of the pmMDA explorer.
// ... public class MyDataObject implements DataObject { // ... private Timestamp timestamp; public Timestamp getTimestamp() return timestamp; } public void setTimestamp(Timestamp timestamp) { this.timestamp = timestamp; } // ... }
MyDataObject myDataObject = new MyDataObject(); Timestamp timestamp = myDataObject.getTimestamp();
// ... public class MyDataObject : IDataObject { // ... private DateTime m_timestamp; public DateTime Timestamp { get { return m_timestamp; } set { m_timestamp = value; } } // ... }
MyDataObject myDataObject = new MyDataObject(); DateTime timestamp = myDataObject.Timestamp;