|
I am thinking about migrating an existing application from J2EE to .NET as an exercise to help learn some of the less conventional enterprise features of .NET and related technologies. Let me mention a few unconventional things I did in J2EE and then get to my question about how I might port these unconventional ideas to .NET.
First, the application is basically middleware. There is no user interface except a web service (or 2 or 3) on the front end. Second, the goals for the application include efficient memory use, low bandwidth, modularity (as in independently deployable apps that discover each other at runtime), and vendor independence. I don't give a hoot about scalability. This is all living on the same machine.
The application receives xml data from several sources at regular and irregular intervals. Separately, clients call a web service to retrieve a filtered set of the data. I've decoupled the client's web service call from receiving the data from the sources so that the client is not impacted by the availability of the sources. The data is kept in an in-memory cache, and I use an xpath/xquery engine to retrieve the data. I don't care about persistence in a database because the cached data is completely replaced over the course of 10 - 120 minutes anyway. And I don't want to spend time installing, configuring, and maintaining a database, not to mention wasting processor, bandwidth, and disk space to send information to it when persistence is so irrelevant.
The unconventional things I did include:
* creating a J2EE-blessed container-managed single instance of an object to hold the memory cache by taking advantage of the MBean feature. I could have used an entity bean, but those god-awful things are anything but vendor-neutral when it comes to deployment.
* take advantage of the J2EE container's management to pass object references between modules (session beans and wars) so that objects aren't copied to the stack. I found that without this feature, the app was so busy putting data on the stack that the garbage collector had no time to run, and the JVM kept running out of memory. Now it uses hardly any memory at all and is blazing fast.
So, what I want to know is:
1. Does the .NET framework allow me to create a single instance of an object that multiple assemblies can access? If so, can someone point me to a reference for doing this?
2. Does the .NET framework allow me to pass objects by reference between assemblies and/or COM+ components? I mean truly by reference to achieve a similar effect as bullet 2 above, not simulated reference via marshalling. If so, is this achieved by a particular attribute or C# keyword?
3. Is there a good reference on doing some serious tricks with enterprise development using .NET? I'm not talking about the 3-dozen shopping cart/course catalog books that are easy to find. I'm talking about some of the less-used, less-conventional, domain-agnostic tricks.
Thank you!
|
|
|
|
|
How do you get an HWND handle inside a Form object in C++, VC2005 ?
Thanks
swine
[b]yte your digital photos with [ae]phid [p]hotokeeper - www.aephid.com.
|
|
|
|
|
It's the .Handle property, I believe.
Christian Graus - Microsoft MVP - C++
Metal Musings - Rex and my new metal blog
|
|
|
|
|
Is it a HWND type? I get a compiler error saying:
Error 3 error C2440: 'type cast' : cannot convert from 'System::IntPtr' to 'HWND'
My code is:
HWND h = (HWND)Handle;
[b]yte your digital photos with [ae]phid [p]hotokeeper - www.aephid.com.
|
|
|
|
|
I'm not sure how to do that conversion, but I've passed the Handle in from C# when I make pinvoked API calls and it's worked fine.
Christian Graus - Microsoft MVP - C++
Metal Musings - Rex and my new metal blog
|
|
|
|
|
That's great but here it doesn't work.
[b]yte your digital photos with [ae]phid [p]hotokeeper - www.aephid.com.
|
|
|
|
|
To verify that the Handle property really contains a HWND:
MSDN quote:
"Syntax
public IntPtr Handle { get; }
Property Value
An IntPtr that contains the window handle (HWND) of the control.
Remarks
The value of the Handle property is a Windows HWND. If the handle has not yet been created, referencing this property will force the handle to be created."
---
b { font-weight: normal; }
|
|
|
|
|
If form was your form object, try:
(HWND)form.Handle.ToPointer()
|
|
|
|
|
Excellent! That's exactly what I needed. Thanks
[b]yte your digital photos with [ae]phid [p]hotokeeper - www.aephid.com.
|
|
|
|
|
Sorry for bumb nood question.
I can't figure out how to transform an XML that I have in a string variable (not a file) using XSLT that is also in a string (not a file) and get the result as a string as well?
All I see there is "Load" methods which take paths to files or XmlReader (which I'm not sure how force to use my strings) or some other wierd stuff.
Please help!
|
|
|
|
|
Hello All,
Is it possible to deploy the CLR on machines where the user has no admin rights ?
There is no possibility for the user to get admin passwd or raised privileges.
Regards
|
|
|
|
|
No there isn't. The user has to have Power User rights or better.
Or a packaged installation has to be pushed to the machine using some software distribution tool, like Altiris or Microsoft's SMS server.
Dave Kreskowiak
Microsoft MVP - Visual Basic
-- modified at 15:03 Monday 10th July, 2006
|
|
|
|
|
How does VS2005 create the design time control, and how can i write my control to detect between the control running on the device , and in VS2005 ? using VS2003 and CF1 I had to create 2 different controls , but now VS handles this , but I canot find any details on how add designtime atributes etc
|
|
|
|
|
Hi,
When I'm compiling an idl file in a project in VC8 2005 on x64 configuration I'm getting the error. The operation could not be completed. Unspecified Error. Any comments on the same. How do I rectify it. Does it require some settings to be done. I have the same error pop up when I try to get the Properties of the project but could not do so.
Thanks
|
|
|
|
|
Does anyone know what the function name is to determine if a .NET application is in design mode, or if it is compiled and running?? The eqivalent in the MFC world was AmbientUserMode(). TIA
|
|
|
|
|
Anything which derives from System.ComponentModel.Component inherits the protected DesignMode boolean property, which returns true if the component is running in a designer. Every control (including Forms) derive from Component.
:josh:
My WPF Blog[^]
|
|
|
|
|
Is there a chance to compile more assemblies to one assembly ?
|
|
|
|
|
1) If you have the source code then yes. Just bring them all into the same project and recompile.
2) If you don't have the source code then you can still KIND of do it by just writing a wrapper library that acts as a proxy to the other individual libraries.
My Blog[^] FFRF[^]
|
|
|
|
|
Please don't cross post.
---
b { font-weight: normal; }
|
|
|
|
|
|
I'm trying to use a treeview control for file searching. I would like to start by the desktop, like a usual program, but I can't find the place here that information is. Environment.GetSpecialFolders seems not given me that information. Can anyone help my?
Thank you.
Hi there
|
|
|
|
|
Have you tried searching CP for explorer treeview[^]?
Obviously not because the first 5 hits are all dealing with this.
|
|
|
|
|
xadrex wrote: Environment.GetSpecialFolders seems not given me that information.
It gives:
Environment.GetFolderPath(Environment.SpecialFolder.Desktop)
|
|
|
|
|
I've tried to sign my assemblies (http://www.codeproject.com/useritems/SecUtilexe.asp?df=100&forumid=256869&exp=0&select=1337472)
but it is not working. I can use assemblies from any application. Is there another solution or things in 2.0 are different?
|
|
|
|
|