I would like to develop a 2D CAD application using .NET Framework WinForms or WPF, can you give me some architectural advices, how to structure the application or recommend some books?
-
I'm not looking to design something extremely complicated, I want to do this just for practice, to get myself familiarized with this kind of application.
-
Answer:
I did something not too dissimilar. It was an application for a graphics modeler and engine, with the graphics done in Open GL and Direct 3D. You're sounds similar, because at least you are going to have to draw some lines for CAD, right? Here's what I found. The .NET part was totally easy to do, with the user interface involving panels and tools and stuff. I didn't even need to look at books to do it. Just open Visual Studio and drag and drop. It's all obvious. The serious graphics part: no way in hell, and I mean that. I had to drop back to C++. Which wouldn't have been so bad, except... The internal interface between C++ and .NET was like arguing with a spastic colon. Getting them to work together took at least 80% of my time. Plus, it was so difficult to do unit tests that it made every other part of development take longer. ETA, because I was asked. Model-view-controller is a fine way to structure, and I think was essential for what I was trying to do. The controller had to be in .NET. The view (well, at least the 3-D part) had to be in C++ or C. Actually, there were multiple views, and some were in .NET, but these were coarse representations of geometry as objects. Some of the controllers had to be in C++, because of certain technicalities. There was a pattern that C# was almost but not quite good enough to implement in an elegant manner, but I could do it in C++ with templates. Anyway, I digress... The problem wasn't the architecture, though it would have been worse under other architectures. The problem was getting meaningful communication between the .NET part and the C++ part. Another question I've recently seen asked whether .NET was a failure. My view is yes, partly because of this awkwardness. If you have a C++ code, it's truly a pain to refactor it. There is no obvious transition mechanism; it's pretty much all or nothing through a narrow channel. So the scaffolding hacks that make transitions possible are pretty much impossible. This was a new code, so it wasn't inconceivable, but it was still way hairy. It's not, for instance, like Objective C, where you can use C functions and even use C++ with .m files. So you can put bits together roughly to see if they work and then refactor to use your nice, well designed glue layer.
Eric Pepke at Quora Visit the source
Other answers
Related Q & A:
- What is the gprs? i WOULD LIKE TO use a GPRS network?Best solution by Yahoo! Answers
- I would like to create a new e-mail address.Best solution by Yahoo! Answers
- I would like to become a medical lab tech.Best solution by eHow old
- I would like be be a medical biller?Best solution by AllExperts
- I would like to compress avi video-clips taken by my camera so that I can send to my contacts by Yahoo email.Best solution by Yahoo! Answers
Just Added Q & A:
- How many active mobile subscribers are there in China?Best solution by Quora
- How to find the right vacation?Best solution by bookit.com
- How To Make Your Own Primer?Best solution by thekrazycouponlady.com
- How do you get the domain & range?Best solution by ChaCha
- How do you open pop up blockers?Best solution by Yahoo! Answers
For every problem there is a solution! Proved by Solucija.
-
Got an issue and looking for advice?
-
Ask Solucija to search every corner of the Web for help.
-
Get workable solutions and helpful tips in a moment.
Just ask Solucija about an issue you face and immediately get a list of ready solutions, answers and tips from other Internet users. We always provide the most suitable and complete answer to your question at the top, along with a few good alternatives below.