Re: Java programmer lured back by .Net (Questions)



Actually I just found out that ngen'd code also contains IL (damn!)

Beatrice Rutger wrote:

Thank you very much Kevin, Thank you. I truly appreciate your help. This is really what a ng should be all about - helping others.

At the risk of boring you, thank you very much. I do appreciate your help. You have saved me several hours of googling and frustration. This is all I wanted to know - not too much to ask for I would have thought, but after reading various articles on the MSDN, downloading and running the VC++ express (and its useless samples), you have answered my question. I am truly grateful - So for the last time. Thank you

Regards,

B

Kevin Anthony wrote:

Ok. There is a tool in .NET call ngen that allows you to create native images of you code so you don't have to deal with JIT. This can be done with an exe or dll. Also, in .NET a form is simply a class so yes it could easily be placed into a DLL and then use Ngen to make a native image of it. Oh yeah, security wise this is native code so it is like a C++ library or VB Exe so it would be pretty hard to reverse engineer. Can you feel me pushing .NET on ya? :-)

For the second question I would create your logic in C++ and use COM for your interop with the VB front end. I don't see the need to pull the VB form into your C++ project. I don't think that's possible. You will probably be encapsulating all your logic in that DLL and with COM the VB front end just has to reference your C++ Dll's and you can interact. If you use .NET for your forms then you have access to all kinds of cool new features that you use to go beyond the bland forms of VB. I admit, I'm biased but I used to be a VB,COM developer. I have seen the light. :-)

Here's a link for the last two questions.

http://support.microsoft.com/default.aspx?scid=KB;en-us;q106553

Good luck.

"Beatrice Rutger" wrote:


Hi Kev,

I have finally decided to put all my business logic in C++ and compile that to native code. The security that offers is good enough for me.
However, I Just a few more questions since If I may :


1). Is it possible to compile a GUI into a native DLL (not jitted)
2). Is it possible to design a form using VB and then use it in a VC++ project?
3). Could you please point me to an example of writing a C++ native Win32 DLL that exports functions
4). Could you please point me to an example of calling functions exported in a native Win32 DLL in a forms based App (better still if the form itself is in a DLL)?


These four questions are really all I need to decide the best way to proceed. After almost four hours of googling I have not found any links that answer these questrions specifically - the only thing I've learnt so far is that there is quite a lot of confusion out there regarding managed code, C++/CLI etc ... but that's a different matter.

I will be very - no, VERY grateful if you could answer at least some of the four questions above

Manth thanks - Bea



Kevin Anthony wrote:


No problem. :-) I saw that another part of your post was about loading libraries on the fly. You can definitely do this in .NET although I've never tried doing it off of a remote machine. Security is the only reason why I could see that being a problem but I'm sure there is a way around it. I have some code out there where I've written code on the fly in my program, compiled it, and the loaded it into memory. .NET allows you to do some pretty cool stuff. Let me know if you have any more questions.
"Beatrice Rutger" wrote:




Thanks Kev :-)

Kevin Anthony wrote:



Wow, that's a lot. I'm a developer who uses both Java and .NET and I can appreciate the best of both worlds. When I develop in .NET I use C# which I think is an awesome language and in many ways is superior to Java. Of course it learned a lot from Java, and improved upon many things which Java is slowly catching up on. Microsoft of course doesn't have to go through the JCP which helps. You will find C# an easy transition from Java. There are libraries within .NET that will allow you to send data over a HTTPS connection along with handling the encoding. As far as code security you're in the same boat as Java since it compiles down to MSIL instead of bytecode of which both can reverse engineered very easily. Get a good obsfucator and you will be fine. Also, yes you can use MDD within .NET. If you don't mind the expense Rational (of course now IBM) makes tools that will allow you to generate code from UML and back and forth. It's the same tools they make for Java. Their Rational XDE is nice but expensive. There are other tools out there though. .NET is much easier to work with for putting together GUI's although using SWT gives a much nicer feel than Swing for creating Java interfaces. They are taylored to the OS so they can get away with a lot more. Also if you're a portability advocate, check out the MONO project which is a great port of .NET for other OS's. Hope this answered a few questions.
"Beatrice Rutger" wrote:





Hi,

I am a previous Micro$oft desertee (moved from VB/VC++ to Java before
this whole DOTNET thing) because I had several issues with Micro$oft. I
am not completely in love with Windoze, but I have to say that Java
SWING sucks BIG TIME for developing and deploying desktop applications
(especially on Windoze).


Unfortunately, I have been dragged kicking and screaming back to my old
haunts - but the landscape has changed somewhat and I would appreciate
some feedback from people with real world experience of what I'm trying
to achieve. Basically, I'm torn between two worlds (Java programmers
hate me for deserting, and are trying to convince me to use the slow
clunky SWING GUI because it's a better fit - yeah tha'll happen!), and
in the past, I have been bombarded by .NET zealots who want me to
re-write my whole backend to use the flaky IISP etc - and I'm like yeah
right!).


My backend is pure Java (J2EE) running on Unix - but because SWING is so
shitty, I basically am forced to use .NET which, with its (Forms?) is
really cool, looks good and allows you to write an application that
really looks and feels at home on a Windoze box - and blows away crappy
lokking SWING applications in sheer performance and looks.


The problems then are this:

1). Inter-operatability (communication between the front end and backend)
2). Code protection at the client side



INTER-OPEATABILITY
====================
I have a J2EE backend and a .NET frontend. I need to get them to
communicate. I do NOT want to use SOAP/XML because it is far too heavy
weight, and I get the performance hit caused by parsing on both sides. I
would like to use something like base 64bit encoding and servlets to
transfer data in binary format between the backend component - I will
issue HTTPS request from the .NET client, receive the request on the
Servlet at the backend, process it and hand the response back (in base
64 bit encoded form). Any ideas about how I can do this on the .NET side
of things (is theer a library for issuing HTTPS requests and handling
base 64 encoded daat?)



CODE SECURITY
==============
Admitedly, this is a problem that Java also has, but we do have class
loaders, and that (along with code obfuscation) can lead to some pretty
secure code. I would like to be able to place my executable on my remote
server (probably as 64 bit encoded ASII strings - since it will be on a
different platorm) and then "load" the executables on demand from
accross the internet - so that there are no executables on the local
machine for prying eyes to reverse engineer. Is there anyway, I can load
binaries from a remote location and then run it on a local machine?. I
will be very interested in knowing if and how this can be done.


I would not need to worry about code security if I was developing with
VB or VC++ - however, the future of VB seems uncertain (is the plug
going to get pulled on VB at some stage or what?), and also last time I
checked (several years ago), VC++ was lousy at creating GUIs - the
DOTNET framework has these nice forms which unfortunately, I cannot use
in VB or VC++ without making the whole damn executable easy to reverse
engineer - is there another way of getting the fantastic GUIs (which is
the only reason I am back), along with the code security of ("non
reverse engineerable") executables?. Is there a language or language
combination that gives me the desired results ?



Lastly, but not the least, can I use MDD (model driven design in .NET)
you know, UML nad design patterns etc to generate the underlying code?.
I sthere a tool that allows me to create UML designs and then generate
the appropriate code in .NET?


I look forward to your responses


Regards,

B.








.