 |
BorlandTalk.com Borland discussion newsgroups
|
| View previous topic :: View next topic |
| Author |
Message |
Rob Guest
|
Posted: Fri Jan 16, 2004 3:58 am Post subject: Linking Business Objects and Visual components? |
|
|
I have been thinking about how I can link a business object with a visual
DB component, but was wondering how others have approached the idea?
I would like to somehow link a business object, say TCustomer (as a back
end style object - so it can be used elsewhere) with the power of using
visual DB style grids/editors on the front end - maybe trying to get the
best of both worlds?
How do others do it? Or is it best to stick to one "style" or the other?
TIA
Rob
--- posted by geoForum on http://delphi.newswhat.com
|
|
| Back to top |
|
 |
DB Developer 4 Hire Guest
|
Posted: Fri Jan 16, 2004 4:48 am Post subject: Re: Linking Business Objects and Visual components? |
|
|
Well you could try instantobjects which has just gone open source.
"Rob" <andrew_rob (AT) hotmail (DOT) com> wrote
| Quote: | I have been thinking about how I can link a business object with a visual
DB component, but was wondering how others have approached the idea?
I would like to somehow link a business object, say TCustomer (as a back
end style object - so it can be used elsewhere) with the power of using
visual DB style grids/editors on the front end - maybe trying to get the
best of both worlds?
How do others do it? Or is it best to stick to one "style" or the other?
TIA
Rob
--- posted by geoForum on http://delphi.newswhat.com
|
|
|
| Back to top |
|
 |
Joanna Carter (TeamB) Guest
|
Posted: Fri Jan 16, 2004 8:41 am Post subject: Re: Linking Business Objects and Visual components? |
|
|
Rob wrote:
| Quote: | I have been thinking about how I can link a business object with a
visual DB component, but was wondering how others have approached the
idea?
I would like to somehow link a business object, say TCustomer (as a
back end style object - so it can be used elsewhere) with the power
of using visual DB style grids/editors on the front end - maybe
trying to get the best of both worlds?
|
IMO DB components can introduce more problems than they can solve.
They rely on a series of events which interact with the dataset they are
connected to; and some of these events can happen when you don't want them
to. e.g. if you move away from certain controls, they try to post the value
in the edit back to the dataset, not always what is wanted. I have seen more
kludge code expended on trying to circumvent the event system than real
business logic :-(
Take a look at the articles on MVP on my website:
www.carterconsulting.org.uk for ideas on how to create object-aware
controls. Come back to here if you have any questions.
Joanna
--
Joanna Carter (TeamB)
Consultant Software Engineer
TeamBUG support for UK-BUG
TeamMM support for ModelMaker
|
|
| Back to top |
|
 |
Andrew Denton Guest
|
Posted: Fri Jan 16, 2004 8:58 am Post subject: Re: Linking Business Objects and Visual components? |
|
|
Rob wrote:
| Quote: | I have been thinking about how I can link a business object with a
visual DB component, but was wondering how others have approached the
idea?
I would like to somehow link a business object, say TCustomer (as a
back end style object - so it can be used elsewhere) with the power
of using visual DB style grids/editors on the front end - maybe
trying to get the best of both worlds?
How do others do it? Or is it best to stick to one "style" or the
other?
TIA
Rob
--- posted by geoForum on http://delphi.newswhat.com
|
Hi Rob,
tiOPF has an object Dataset which allows you to connect your business
objects to data-aware controls should you so wish.
http://www.techinsite.com.au
--
Cheers,
Andy
"I want to move to Theory....Everything works in Theory"
|
|
| Back to top |
|
 |
Paul Guest
|
Posted: Fri Jan 16, 2004 9:37 am Post subject: Re: Linking Business Objects and Visual components? |
|
|
"Rob" <andrew_rob (AT) hotmail (DOT) com> wrote
| Quote: | I have been thinking about how I can link a business object with a visual
DB component, but was wondering how others have approached the idea?
|
You could create a dataset descendent that uses your BO as the source for
it's records. Gerald Nunn wrote some articals on how to do this. I believe
that Joanna Carter also wrote some articals on this subject.
| Quote: | I would like to somehow link a business object, say TCustomer (as a back
end style object - so it can be used elsewhere) with the power of using
visual DB style grids/editors on the front end - maybe trying to get the
best of both worlds?
How do others do it? Or is it best to stick to one "style" or the other?
|
It is not so much sticking to one style in your architecture. I would say
that it is more important to once you have found a usable architecture make
sure that it is applied consistently across the applications that use it.
If it is not then your architecture is redundant and just adding to the
complexity of the application not reducing it.
regards
Paul
|
|
| Back to top |
|
 |
Trevor de Koekkoek Guest
|
Posted: Fri Jan 16, 2004 3:02 pm Post subject: Re: Linking Business Objects and Visual components? |
|
|
I've created an object dataset in the past and it works quite well. In my
opinion this is a good way to go as you don't want or need to create your
own databinding mechanism. Another option is to use the excellent
components from Developer Express. Their data-binding mechanism allows you
bind with or without datasets.
-Trevor
"Rob" <andrew_rob (AT) hotmail (DOT) com> wrote
| Quote: | I have been thinking about how I can link a business object with a visual
DB component, but was wondering how others have approached the idea?
I would like to somehow link a business object, say TCustomer (as a back
end style object - so it can be used elsewhere) with the power of using
visual DB style grids/editors on the front end - maybe trying to get the
best of both worlds?
How do others do it? Or is it best to stick to one "style" or the other?
TIA
Rob
--- posted by geoForum on http://delphi.newswhat.com
|
|
|
| Back to top |
|
 |
Steffan Surdek Guest
|
Posted: Tue Jan 20, 2004 2:07 pm Post subject: Re: Linking Business Objects and Visual components? |
|
|
Rob,
I've done a combination of things... I have some object aware controls for
the basics (i.e.: TEdit, TRadioButton, TCheckbox, TComboBox type controls).
These controls are aware of my business objects and how to interface with
them to set / retrieve values. If you change the value of an object
directly in code, the visual control is automatically updated.
One of my objects is a generic container that contains a list of field names
and data similar to retrieving data from a TDataset. For this container, I
convert the data to a memory dataset and then I can use a db grid to
populate the data. Once I'm done editing the data, I repackage it in the
object and do whatever I need to do. This is not as elegant as the object
aware controls but it is only for specific cases where this data needs to be
edited but it works fine for my purposes at the moment. The main benefit of
doing it this way for the lists of data is that I can use a nice DB aware
grid like QuantumGrid to browse / edit the data in different ways.
Steffan
"Rob" <andrew_rob (AT) hotmail (DOT) com> wrote
| Quote: | I have been thinking about how I can link a business object with a visual
DB component, but was wondering how others have approached the idea?
I would like to somehow link a business object, say TCustomer (as a back
end style object - so it can be used elsewhere) with the power of using
visual DB style grids/editors on the front end - maybe trying to get the
best of both worlds?
How do others do it? Or is it best to stick to one "style" or the other?
TIA
Rob
--- posted by geoForum on http://delphi.newswhat.com
|
|
|
| Back to top |
|
 |
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
|