In our C# code, we have a class called Project. Our base BusinessObject class (that all business objects inherit from) defines a property:
public Project Project { get; set; }
This is normally not a problem as long as we stay within the C# codebase. However, these business object classes are exposed in web services over the wire. Some consuming languages (such as Flex's actionscript) cannot handle having a property with the same name as its class.
This naming conflict happens all over the place in our code. Sometimes it's easy to change the name of the property or class. Sometimes it's really hard. We've wracked our brains and can't come up with a good standard way to handle this. It's possible to rename the Project class to ProjectType or ProjectInfo, but this is ugly and breaks all of our consumers' existing code. We could leave the type name the same and change the name of the property to ProjectInfo, but this causes the same problem.
Does anyone have any guidance or best practices for such a situation?
EDIT: Responding to some of the suggestions given:
- Methods aren't exposed over the wire, so we can't use methods.
- I'd prefer a standard naming convention that also adheres to Microsoft's own naming standards.
- Exposing a different contract for Flex may be an option. However, we're using Weborb for Flex interop. Weborb uses reflection to match the property names exactly, rather than using XML or SOAP serialization. If anyone knows more about custom serialization with Weborb, that would be helpful.