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



Hi Daniel,

Thanks for the post. Reaklly useful info. Apologies if I was a bit cranky at first... I think the solution I'm going to go for is Managed C++ for the GUI and then my business logic in native DLLs.

I guess I was a little peeved because I have to maintain two branches of code - just because Java has not got its act together yet on the desktop side - despite all the years of promise.

Many thanks for your feedback

B.


Daniel O'Connell [C# MVP] wrote:

"Beatrice Rutger" <brutger@xxxxxxxxxxx> wrote in message news:d81fpu$s1t$1@xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx

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).


First thing, it would *really* help to not be so hostile when asking questions of this magnitude. Answering you is going to be a bit of an investment of time and few are going to want to put the time in if all they expect in return is the same level of scarcasm and self-indulgent behavior that went into the question. Insulting the technology that the people whom you are asking questions of are using isn't the best way to go about things.


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.


Have you ever considered a different java UI toolkit? I'm sure there are others out there. You would clearly prefer to stay with java, so why not explore alternatives in the java space first?


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?)


Issuing requests is pretty simple, WebRequest and WebClient allow you to access http and https uris, as I recall. Going too and from Base64 can be achieved with methods on the Convert class. Hit MSDN and look up these classes for the specifics.


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.




Sure, you can. You'll have to create a shell app that loads the assemblies you want, but Assembly.Load will take a byte array containing the raw assembly file, all you would have to do is download it and decrypt\decode it. I still don't think this will help your security much, but it does force people to try a little harder I suppose.

The WebClient class should help with your downloading.


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 ?



I don't think VB is going any where anytime soon. It is in the 2k5 beta project and going strong. If you want native code and UI's, you are going to have to use C++ and use a different windowing toolkit. WinForms come with all the advantages and drawbacks of managed code, the ones that are there in all of your java apps and that I doubt you are really circumventing, I might add.


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'm sure there is, google is your friend. MS has some tools in the works, but I do not believe any of them are available for general purpose usage yet. Other companies, however, do have .NET modelign tools out. I don't use UML so I don't really know much about them.



.