By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
460,028 Members | 1,258 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 460,028 IT Pros & Developers. It's quick & easy.

Any Delphi Programmers? I need help big time...

P: n/a
I was wondering if .NET had the equivalent of Frames, Global Objects, and
most importantly DataModules like in Delphi?
Oct 6 '06 #1
Share this Question
Share on Google+
5 Replies


P: n/a
It's been a while but let me see if I can make some suggestions that you will
find helpful.

Frames are essentially ways of reusing forms.
..NET offers three options
1. Use user templates to get save the base form. You can create your own
templates. Then select the appropriate user template when creating a new form
in the IDE. Modify the new form as appropriate.

2. You can use inheritance to create a stack up of structures each of which
is a form since you start with a form but each layer adds some functionality.
(My main form is something like 5 layers above the base form derived from
windows.forms.form.) I didn't create a template (as in 1) so after creating a
new windows form I go into the designer.vb for the new form and change the
inherits to the appropriate member in my library.

3. You can use user controls to encompass a lot of stuff (as in everything
in your frame.) You can put that user control on the tool bar and drag it on
to a newly created form.

Bottom line lots of ways to handle the idea of frames.

---------------

Data modules. You'll have to work a bit harder here. You can define data
sets which have one or more data tables in them. You can control various
behaviors at the event level for fields, tables, etc. In a dataset you can
also provide for connecting to an external database and for manipulating the
data. (The exact details depend upon whether you are going against an SQL
engine or an ODBC engine and because of MS design decisions never the twain
shall meet. If a database engine is to be involved settle on SQL or ODBC
right at the beginning. If you have your choice consider the ease of use of
the relatively new MS SQL desktop engine which you may freely distribute.)
You can put multiple data sets into a library. You can put the datasets on a
tool bar and drag them on as needed or simply instantiate them in your code.
If you have existing databases, you can automagically use the IDE to create
the data sets. (I haven't done this lately so I won't spout off on it.)

You can even do things like use the data sets against XML so that you don't
even need a database engine going to get to data. You just read the XML into
the data set when you need it in the program. In a few lines you can also
encrypt and/or compress the XML. I reduced the hassles of a 2 MB ACCESS
database with its attendant DLL hell to 100 KB and about 6 lines for writing
it and 6 lines for reading it!

As you can see the possibilities of encapsulation are endless as are the
various ways of handling data.

Global Objects. Don't remember this as a concept in Delphi though I probably
used it all the time:-)))
You have complete control over the exposure of stuff in libraries and
programs. For example I have a units library that handles the engineering
conversions between US and metric units. It exposes its various routines and
thingies by marking them public. In other modules I just code
units.convert(...) when I want to do a conversion. I just as easily refert to
units.g when want the acceleration of gravity. It is a global constant but it
could just as easily be a global object.

So it's very straight forward. HOWEVER, before you code anything make sure
that you thoroughly understand why properties are neat. Those of us who
remember teaching structured programming when it first came out will also
strongly urge you to do a careful analysis of what should be global and what
should not. Life is much cleaner when you pass nearly everything as
parameters. In my current work I'm instantiating all the data tables in the
main form. I pass the main form to any routine that needs multiple thingies
that are in the main form rather than passiing the individual thingies. THen
I can refer to the thingies in the routine through the main form.

Regards,
Al

--
Regards,
Al Christoph
Senior Consultant
Three Bears Software, LLC
just right software @ just right prices @ 3bears.biz
Microsoft Certified Partner (ISV)
Coming soon: Windows Mail for Vista.

"Ming Yeung" wrote:
I was wondering if .NET had the equivalent of Frames, Global Objects, and
most importantly DataModules like in Delphi?
Oct 6 '06 #2

P: n/a
Thanks for the response Chris...

Basically what i am looking for is having a global dataset, whether it be
created at design time or at run time...

For instance I want to create a customers dataset, that is attached to a
combo box, when i select a customer from the combo box, i want the underlying
dataset to go to that record, so that any other controls that use a
datasource asscoiated with the customers dataset will reflect the change
Oct 6 '06 #3

P: n/a
I was just reading the difference between Delphi and .NET and I realized that
..NET allows circular reference. That will definetly help if I want to use
the concept of global objects.
Oct 6 '06 #4

P: n/a
Dephi and .NET...come to think of it they are very much the same. Its good MS
adopted the concepts so late in the game, or Borland might have sued. :))
Oct 7 '06 #5

P: n/a
You may wish to investigate the history of .net. If memory serves me
correctly MS lured away some key Borland compiler folk a while back and they
made a big difference.

Has Borland figured out what it wants to do when it grows up?

On the techie side, the original poster will have no problems doing what she
wants. You can isolate things and inherit things and protect things and
expose things to your hearts content. From experience, I'd strongly suggest
that good structuring and programming practices will pay off.
--
Regards,
Al Christoph
Senior Consultant
Three Bears Software, LLC
just right software @ just right prices @ 3bears.biz
Microsoft Certified Partner (ISV)
Coming soon: Windows Mail for Vista.

"LouArnold" wrote:
Dephi and .NET...come to think of it they are very much the same. Its good MS
adopted the concepts so late in the game, or Borland might have sued. :))
Oct 7 '06 #6

This discussion thread is closed

Replies have been disabled for this discussion.