How do you avoid name similarities between your classes and the native ones?
Posted
by
Oscar
on Programmers
See other posts from Programmers
or by Oscar
Published on 2011-11-24T19:29:20Z
Indexed on
2011/11/25
2:17 UTC
Read the original article
Hit count: 237
I just ran into an "interesting problem", which I would like your opinion about:
I am developing a system and for many reasons (meaning: abstraction, technology independence, etc) we create our own types for exchanging information.
For instance: if there is a method which is called SendEmail and is invoked by the business logic, it way have a parameter of type OurCompany.EMailMessage, which is an object which is completely technology independent and contains only "business relevant data" (for instance, no information abut head encoding).
Inside the SendEmail function, we get this information from our EMailMEssage object and create a MailMessage (this one is technolgy specific) object so it can be sent over the network.
As you can already notice, our class has a very similar name to the "native" language class. The problem is: this is exactly what they are, email messages, so it is hard to find another meaningful name for them.
Do you have this problem often? How do you manage it?
Edit: @mgkrebbs just commented about using fully qualified names. This is our current approach, but a little bit too verbose, IMHO. I would like something cleaner, if possible.
© Programmers or respective owner