Jump to content
  • Advertisement
Sign in to follow this  
FxMazter

[.net] designing in .net

This topic is 4914 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Hi! I recently started programming in c#. Found it very easy, since I had programmed som Java and a lot C++ before. Now, I'm used to make interfaces for everything :) But now that I'm programming c#, maybe I'm overexaggerating ? My main concern is the core functions like FileStreams and stuff like that. In C++ I had to abstract everything to make it crossplatform, but I hear that there will be some sort of .net drivers for unix as well? So I might just as well use the core functions for FileStreams etc? Thx!

Share this post


Link to post
Share on other sites
Advertisement
In theory, C# will require the .NET common runtime to work, regardless of the hardware or OS it runs on, so you can use any .NET component in your program safely, knowing all .NET implementations are supposed to behave the same way.

Share this post


Link to post
Share on other sites
I had a similiar problem abt a year ago when I started on .NET. More specifically I was doing something silly with DLL's (Assemblies) ie. Having a DLL Exporter factory that would get me the correct class at runtime.

This was a good design in C++ using export functions
eg.

HRESULT WINAPI DLLQueryObject(REFIID riid, void** ppvObj);

called with

CMentalRayRender* r = NULL;
... //dll loading and GetProcAddress here ...
dllPROC(IID_IMentalRayRenderer, &r);

This DOES NOT need to be done in .NET.
All u do is ..

using MentalRayPlugin;
...

MentalRayPlugin r = new MentalRayPlugin();

One has to think and design differently in .NET as there is no need for certain "tricks" that one used in C++. eg. exporting pointers/classes from DLL's.

And so on and so forth ...

Share this post


Link to post
Share on other sites
Don't program in .NET expecting to make cross platform programs or you may be disappointed for awhile.

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

Participate in the game development conversation and more when you create an account on GameDev.net!

Sign me up!