This thread looks to be a little on the old side and therefore may no longer be relevant. Please see if there is a newer thread on the subject and ensure you're using the most recent build of any software if your question regards a particular product.
This thread has been locked and is no longer accepting new posts, if you have a question regarding this topic please email us at support@mindscape.co.nz
|
Hi guys, Can I make a suggestion for a slight tweak to the code generated by the Lightspeed Desigener... can you change it to include the "global" namespace prefix on all references to the System namespace? This would stop any problems with the designer generated code if there is a conflicting namespace nearby - ie: I have a class named "System" that is conflicting with the "System" namespace. Take a look at the code created by the VS Dataset designer - this uses this technique extensively. Eg: Generate this:
[ global::System.CodeDom.Compiler.GeneratedCode("LightSpeedModelGenerator", "1.0.0.0")]
public partial class MyUnitOfWork : Mindscape.LightSpeed.UnitOfWork instead of this...
[System.CodeDom.Compiler.GeneratedCode("LightSpeedModelGenerator", "1.0.0.0")]
public partial class MyUnitOfWork : Mindscape.LightSpeed.UnitOfWork Cheers, Greg |
|
|
Thanks for the suggestion, Greg. We basically have a tradeoff between safety and readability here: using global:: guarantees safety in the presence of clashing namespaces and type names, but increases "noise" in the generated code. You can reasonably argue that "it's generated code, readability shouldn't matter" but in practice we've found that customers do like to look at the generated code. That said, it may be that the only places we'd need to add global:: would be FQTNs which are already pretty messy to look at, so the readability impact wouldn't be significant (the entity bodies would be mostly unaffected). I've logged a feature request for this, and we'd love to hear feedback from other customers on whether this would be a welcome or unwelcome change! |
|