Sign in to follow this  

[.net] designing in .net

This topic is 4759 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
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

This topic is 4759 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.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this