|
I've looked at db4o and other OO/ORB's - but they involve substantial work.
The DS is basically a relational architecture and Java is purely Object Oriented - inherently antagonistic paradigms (d**n - I said the P word!).- and predictably they don't mix well – like Chocolate Herring pie. The focus of my original question is to identify how others in my position have managed to get these things to work together in a nice, efficient manner.
So far that leaves me with three things to consider …
Replacing the DS completely means refactoring the code to use pure objects rather than the DS, adding custom binding code, adding all the object management logic (collections, relationships, database operations, matching the current behaviors exactly INCLUDING the errors, and tripling the project time with x thousand hours of regression tests, and possibly (probably) writing conversion test tools, enduser conversion tools, conversion backout tools, etc., etc., etc., etc., etc., etc., etc …… I wouldn’t want to do this for a simple standalone app let alone a multitier! it is far easier to just rewrite the whole thing.
Alternatively, supplementing the DS with a layer of pure object classes means more objects to design, code and maintain, DS to Object/Object to DS translation logic with increased potential for data logic/transcription errors, more complex change management processes (which would really endear me to the CM team), and god knows how much time to rewrite the developer documentation, utility classes, etc. I don’t know that this isn’t as messy as the other option.
The only reasonable option I've seen so far is to build specialized custom serializer/deserializer logic in both .NET and Java. While that brings its own issues with it, it is at least workable (subject to my continued research).
Last point ...
Eventually, we developers are going to have to force some integration standards on Microsoft, Sun, and IBM regarding the standardization between .NET and Java structures rather than trying to do it ourselves and being beaten bloody in the process.
Nothing is impossible, we just don't know the way of it yet.
|
|
|
|
|
If you have a database and you want to display relational data or do data processing via datasets, then datasets are a good choice. If your application is on the web, most of the time, you have to repopulate the datatsets to match the database each time you do a postback. With a Windows application, you don't have this problem but you run into the problem of keeping the data up-to-date. Datasets are great and have a lot of nice features but they do pose a resource hit when they grow beyond a certain size. As I said earlier, .NET 2.0 has improved performance and handles large datasets well. .NET 1.x datasets are slow.
I use a combination of datasets, business objects and XML in my projects. Since I can store and query XML on MS SQL and Oracle, I have been using that option more and more in my projects due to their hierarchical nature. Neverthess, using the XML DOM to process large documents is not recommended, IMHO. Business objects do require more work! Nevertheless, you have more control of the process to tweak for performance and to reduce resource overhead.
-- modified at 6:44 Wednesday 22nd February, 2006
|
|
|
|
|
|
Hi,
I have project written in .NET 1.1. It uses also some libraries of third parties (Firebird .Net provider and TAO - OpenGL library).
I want to transfer it to .NET 2.0.
I want to ask if there is 100% backwards binary compatibility in .NET 2.0. I mean, if I use for example TAO library compiled under .NET 1.1 in my .NET 2.0 app.. Will it correctly work under .NET 2.0?
And case, when I have only .NET 2.0 installed on system and 1.1. not.
Will be working everything compiled under 1.1 correctly. ??
For first I have tried to compile entire my project (except firebird provider and TAO) and it seems to work after a few tests.
I have tried to found something online on MSDN but without the results
Peter
|
|
|
|
|
Well in theory most of the code should work.
But in practise you will not know until you actually try;)
Q:What does the derived class in C# tell to it's parent?
A:All your base are belong to us!
|
|
|
|
|
CWIZO wrote: Q:What does the derived class in C# tell to it's parent?
A:All your base are belong to us!
Your derived class is talking in the first person plural!
|
|
|
|
|
Don't you know the "All your base are belong to us!" joke?
http://en.wikipedia.org/wiki/All_your_base_are_belong_to_us
Q:What does the derived class in C# tell to it's parent?
A:All your base are belong to us!
|
|
|
|
|
Thanks! My Engrish is rusty.
|
|
|
|
|
hello all!
i have the folowing question:
i have the program that works with excel and word, and want to package these 3 versions into one setup project, that could define what version of office is installed on the user's PC and install the program the user needs.
coudl u help me?
thanx in advance.
Andrew.
|
|
|
|
|
Hi All,
I want to have an .net windows app that starts off with a openFileDialog
to choose the file to process. Works fine but I seem to be unable to dispose of the parent form properly.
How do I accomplish this?
|
|
|
|
|
You want to dispose of the parent form, or just hide the form that the open file dialog will lead to?
Because if you just hid the receiving dialog, you could just hide the dialog onload and show the openFileDialog. That'd work, right?
|
|
|
|
|
I want to dispose of it after the app ends. It hangs around and doesn't
delete itself.
Cindylou10
|
|
|
|
|
ok, im stuck in a very stupid situation.
I have a checkbox, i change it's value through user input AND through runtime code.
Problem:
When i change the value by code, it fires the checkedchanged event, which, in my opinion, is pretty damn stupid. I know it works for most people, and it may look normal to most people, but for me is very stupid. Example: u have a checkbox that, when pressed, if a certain condition is met, calls a function and changes another checkbox state (or even himself), WITHOUT triggering the changedevent. Y? Cause i want to separate user input from runtime code changes and this stupid control (and others,from what i've seen) mix it all up!
Do you know any property to avoid this or another event, to avoid this stupid behavior?
Thanks in Advance!
|
|
|
|
|
I checked in both .Net Framework 1.1 and 2.0, and the programmically changing the checkbox value does not fire the CheckedChanged event. The following example demonstrates this. If you toggle the checkbox, the textbox goes from String.Empty to 0 and, subsequently each time the checkbox gets toggled, the number in the textbox gets incremented. However, when you click on the button, the checkbox gets toggled but the textbox does not display the above described behavior.
Framework 2.0
Default.aspx:
<%@ Page Language="C#" AutoEventWireup="true" CodeFile="Default.aspx.cs" Inherits="_Default" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" >
<head runat="server">
<title>Untitled Page</title>
</head>
<body>
<form id="form1" runat="server">
<div>
<asp:TextBox ID="TextBox1" runat="server"></asp:TextBox></div>
<div style="margin-top: 10pt;">
<asp:CheckBox ID="CheckBox1" runat="server" AutoPostBack="True" OnCheckedChanged="CheckBox1_CheckedChanged" />
</div>
<div style="margin-top: 10pt;"><asp:Button ID="Button1" runat="server" Text="Button" onclick="Button1_Click" /></div>
</form>
</body>
</html>
Default.aspx.cs:
using System;
using System.Data;
using System.Configuration;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;
public partial class _Default : System.Web.UI.Page
{
protected void Page_Load(object sender, EventArgs e)
{
}
protected void CheckBox1_CheckedChanged(object sender, EventArgs e)
{
int value = 0;
if (Int32.TryParse(TextBox1.Text, out value))
{
TextBox1.Text = (++value).ToString();
}
else
{
TextBox1.Text = value.ToString();
}
}
protected void Button1_Click(object sender, EventArgs e)
{
CheckBox1.Checked = (CheckBox1.Checked) ? false : true;
}
}
|
|
|
|
|
Same for Windows Forms:
Windows Form Designer:
namespace CheckWin
{
partial class Form1
{
/// <summary>
/// Required designer variable.
/// </summary>
private System.ComponentModel.IContainer components = null;
/// <summary>
/// Clean up any resources being used.
/// </summary>
/// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
protected override void Dispose(bool disposing)
{
if (disposing && (components != null))
{
components.Dispose();
}
base.Dispose(disposing);
}
#region Windows Form Designer generated code
/// <summary>
/// Required method for Designer support - do not modify
/// the contents of this method with the code editor.
/// </summary>
private void InitializeComponent()
{
this.textBox1 = new System.Windows.Forms.TextBox();
this.checkBox1 = new System.Windows.Forms.CheckBox();
this.button1 = new System.Windows.Forms.Button();
this.SuspendLayout();
//
// textBox1
//
this.textBox1.Location = new System.Drawing.Point(12, 23);
this.textBox1.Name = "textBox1";
this.textBox1.Size = new System.Drawing.Size(100, 20);
this.textBox1.TabIndex = 0;
//
// checkBox1
//
this.checkBox1.AutoSize = true;
this.checkBox1.Location = new System.Drawing.Point(143, 25);
this.checkBox1.Name = "checkBox1";
this.checkBox1.Size = new System.Drawing.Size(80, 17);
this.checkBox1.TabIndex = 1;
this.checkBox1.Text = "checkBox1";
this.checkBox1.UseVisualStyleBackColor = true;
this.checkBox1.Click += new System.EventHandler(this.checkBox1_Click);
//
// button1
//
this.button1.Location = new System.Drawing.Point(22, 81);
this.button1.Name = "button1";
this.button1.Size = new System.Drawing.Size(75, 23);
this.button1.TabIndex = 2;
this.button1.Text = "button1";
this.button1.UseVisualStyleBackColor = true;
this.button1.Click += new System.EventHandler(this.button1_Click);
//
// Form1
//
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.ClientSize = new System.Drawing.Size(292, 171);
this.Controls.Add(this.button1);
this.Controls.Add(this.checkBox1);
this.Controls.Add(this.textBox1);
this.Name = "Form1";
this.Text = "Form1";
this.ResumeLayout(false);
this.PerformLayout();
}
#endregion
private System.Windows.Forms.TextBox textBox1;
private System.Windows.Forms.CheckBox checkBox1;
private System.Windows.Forms.Button button1;
}
}
Windows Form Code:
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;
namespace CheckWin
{
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
}
private void button1_Click(object sender, EventArgs e)
{
checkBox1.Checked = (checkBox1.Checked) ? false : true;
}
private void checkBox1_Click(object sender, EventArgs e)
{
int value = 0;
if (Int32.TryParse(textBox1.Text, out value))
{
textBox1.Text = (++value).ToString();
}
else
{
textBox1.Text = value.ToString();
}
}
}
}
|
|
|
|
|
George's replies line up with what I've found, but if it's still messing up for you, you could always set a variable with the click function and with the code, and check that variable on check changed before you run anything else.
if(clicked == false)
//click toggled
else
//code toggled
|
|
|
|
|
Meh!
Sorry for the inconveniance. I was handling the CheckedChanged Event, not the click event. It's my 1st .Net project, usually i do c++ stuff, and as i am still a bit suspicious about .net, i thought it was another weird VB-like think they had.:->
Thank you all for the quick response.
|
|
|
|
|
What he is referring to is a boolean flag variable:
Pseudo Code:
class
{
protected:
void CheckedChanged()
{
if (flag)
{
//Process whatever
}
}
void RunTimeCode()
{
flag = false;
// Change Checkbox via code
flag = true;
}
private:
bool flag = true;
}
-- modified at 20:55 Friday 17th February, 2006
|
|
|
|
|
show about "AddMessageFilter" of Aplictaion class
maybe is parallel function in Control class
|
|
|
|
|
Ok, I am using a global hook, and I am wondering how I can keep the keys from sending to the active program.
I searched around the net and CodeProject and I just can't figure it out. I'm not terribly familiar with WindowsAPI stuff.
Thanks in advance.
-- modified at 19:33 Friday 17th February, 2006
|
|
|
|
|
You just figured it out? So, what is your problem?
-- modified at 19:23 Friday 17th February, 2006
|
|
|
|
|
Just *can't* figure out.
Why is it that we always leave out the mosti mportant words? haha.
|
|
|
|
|
This might help: http://msdn2.microsoft.com/en-us/library/system.windows.forms.application.addmessagefilter.aspx[^]
<br />
static void Main() <br />
{<br />
Application.AddMessageFilter(new TestMessageFilter());<br />
Application.Run(new Form1());<br />
}<br />
<br />
public class TestMessageFilter : IMessageFilter <br />
{<br />
public bool PreFilterMessage(ref Message m) <br />
{<br />
const int WM_KEYDOWN= 0x0100;<br />
if (m.Msg==WM_KEYDOWN) <br />
{<br />
MessageBox.Show("KeyDown hitted"); <br />
}<br />
<br />
return false;<br />
}<br />
}<br />
<br />
-- modified at 19:54 Friday 17th February, 2006
|
|
|
|
|
What type of hook are you using? A really global hook that captures all keyboard events from the whole system, or a hook that only applies to one application? Maybe you can show us a bit of code?
"..Commit yourself to quality from day one..it's better to do nothing at all than to do something badly.."
-- Mark McCormick || Fold With Us! || Pensieve || VG.Net ||
|
|
|
|
|
It is a global keyboard hook. I am using the Kennedy.ManagedHooks DLL from this site. I enable it with a hotkey, and disable it the same way.
public Form1()<br />
{<br />
Form1.RegisterHotKey(this.Handle,this.GetType().GetHashCode(), 8, (int)'P');<br />
InitializeComponent();<br />
keyboardHook = new Kennedy.ManagedHooks.KeyboardTracking();<br />
keyboardHook.KeyboardEvent += new Kennedy.ManagedHooks.KeyboardTracking.KeyboardEventHandler(keyboardHook_KeyboardEventExt);<br />
<br />
}<br />
protected override void WndProc(ref Message m)<br />
{<br />
if (m.Msg == 0x0312)<br />
if (keyboardHook.IsHooked)<br />
{<br />
keyboardHook.UninstallHook();<br />
input = false;<br />
textBox4.Text = "";<br />
}<br />
else<br />
{<br />
textBox4.Text = "";<br />
keyboardHook.InstallHook();<br />
input = true;<br />
}<br />
base.WndProc(ref m);<br />
}<br />
private void keyboardHook_KeyboardEventExt(Kennedy.ManagedHooks.KeyboardEvents kEvent, Keys key)<br />
{<br />
bool shi;<br />
if(keyboardHook.ShiftPressed == true)<br />
shi = true;<br />
else<br />
shi = false;<br />
if(kEvent == KeyboardEvents.KeyDown){<br />
string msg;<br />
if(shi == true)<br />
msg = key.ToString();<br />
else<br />
msg = key.ToString().ToLower();<br />
textBox4.Text += msg;<br />
}<br />
}<br />
I think that covers all the relevant code from my end of the application. If there are any questions about what anything does more specifically, I can answer those. The Hotkey works fine, and I am planning to add the message filter or whatever when it hotkeys in and remove it when they hotkey out of the hook, obviously. Thanks for the help thus far.
|
|
|
|
|