SDOs in .Net Forms

Posted by jjgomez on 04-Apr-2012 02:42

I'm trying to reuse adm2 SmartDataObjects (SDOs) as a data source to develop data maintenance forms (browse, add, delete and modify records).

Has anyone done something similar? Do you have any examples about this?

Thanks in advance,

Juanjo

All Replies

Posted by Peter Judge on 04-Apr-2012 07:55

jjgomez wrote:

I'm trying to reuse adm2 SmartDataObjects (SDOs) as a data source to develop data maintenance forms (browse, add, delete and modify records).

Has anyone done something similar? Do you have any examples about this?

Thanks in advance,

Juanjo

When you say 'data source', do you mean being able to connect an SDO to a ProBindingSource? Or do you mean a datasource for a Business Entity-type construct? (ie on the server). I'm guessing the ProBindingSource way, but just wanted to comfirm.

If you want to attach a SDO to a PBS, all you need to do is get the SDO's DataHandle (which is a query handle) and atttach it to the PBS's Handle property. You'll obviously also need to get the SDO's data first.

I've attached a class which wraps an SDO for an example.Start with Initialize() and then GetQuery(). I would not expect it to compile, but hopefully its intent is clear.

-- peter

Posted by jjgomez on 04-Apr-2012 11:38

Hello Peter,

When you say 'data source', do you mean being able to connect an SDO to a ProBindingSource? Or do you mean a datasource for a Business Entity-type construct? (ie on the
server). I'm guessing the ProBindingSource way, but just wanted to comfirm.

Yes, I am looking for a ProBindingSource solution.

If you want to attach a SDO to a PBS, all you need to do is get the SDO's DataHandle (which is a query handle) and atttach it to the PBS's Handle property. You'll obviously also need to get the SDO's data first.

I'm trying to build a model in that way. (I attached my example). Also I found a document that explains some of the issues to be taken into consideration:
http://download.psdn.com/media/exch_audio/2008/DEV/DEV-40_Fechner.pdf

However, I'm stuck because I don't know in detail the internal architecture of the SDOs and I have lot of doubts:

- How can I send data to the SDO to update in the database?

- How can I work with addRow and fields initialization?

- How can I detect a DataAvailable event?

- How can I know if I reached the first record or last?

- How can I subscribe events published in the SDO?

and many other questions ...

Like other Progress users (I guess), I am pleased that Progress has opened a way to improve the graphics environments of our applications by integrating .Net, but there is not anything like ADM2 to provide us with a framework to integrate business logic objects, we had developed in ADM2, with the new GUI .Net.

[View:~/cfs-file.ashx/__key/communityserver-discussions-components-files/19/sdocontrol.cls.zip:550:0]

Thanks for your sample, At first glance I can see that your code has been taken from a larger context that seems designed to solve this integration problem between SDOs and GUI. Net. Is there any way I can see the full framework you're using? Is this a Progress sample?

Posted by asthomas on 04-Apr-2012 11:41

Jeg er væk fra kontoret indtil den 10. april, og checker ikke altid mail og telefon regelmæssigt. Jeg vil dog svare på din mail så snart som muligt.

Hvis du har behov for support, kontakt venligst support@app-solutions.com, så vender vi tilbage så snart det er mnuligt.

Administrative henvendelser kan ske til : admin@app-solutions.com.

I am not in the office until April 10th 2012. I will not be checking my mail and phone on a regular basis, but will reply to your mail as soon as I can.

If you need support from appSolutions, please send your mails to support@app-solutions.com.

If you need Roundtable support, please send mails to :

support-europe@roundtable-tsms.com.

Med venlig hilsen / Regards

Thomas Hansen

appSolutions a/s

Posted by Admin on 04-Apr-2012 12:20

Like other Progress users (I guess), I am pleased that Progress has opened a way to improve the graphics environments of our applications by integrating .Net,

Indeed!

but there is not anything like ADM2 to provide us with a framework to integrate business logic objects, we had developed in ADM2, with the new GUI .Net.

 

The closest you can find from PSC are is AutoEdge2 and the underlying framework (Peter Judge who replied to you earlier did a great job there). However it's not taking ADM2 and SDO's into any consideration and not meant to be a supported framework. Others (like us) have built commercial frameworks to make usage of GUI for .NET more productive. We have developed different commercial framework solutions that all can be used with ADM2 components in one way or the other. Are you attending the PUG Challenge Americas in May? I could give you a presentation there on our booth.

Thanks for your sample, At first glance I can see that your code has been taken from a larger context that seems designed to solve this integration problem between SDOs and GUI. Net. Is there any way I can see the full framework you're using? Is this a Progress sample?

Not sure if you have found it already, but the sample code is available here: http://communities.progress.com/pcom/message/26470#26470

- How can I send data to the SDO to update in the database?

Difficult task, when you are not experienced with the ADM2 internals.

- How can I work with addRow and fields initialization?

I'd have to look into the code, but isn't addRow supposed to return the Initial Values?

- How can I detect a DataAvailable event?

Set the BindingSource to Batching and subscribe to the OffEnd event. This should be implemented in the above mentioned sample code.

However, the GUI for .NET is designed to support (.NET standard) forward batching only. The SDO was built to support INDEXED-REPOSITION and backwards batching as well. It is possible to implement this with GUI for .NET , but requires a lot of work (speaking from experience).

- How can I know if I reached the first record or last?

First Record: bindingSource1:Position = 0, Last record: you need to compare the RowIdent of the current available row (a field in the RowIdent temp-table) with the LastRowIdent property of the SDO.

- How can I subscribe events published in the SDO?

A class cannot subscribe to procedural events (SDO). You'll need to use a stub procedure that subscribes to those events and that then calls into PUBLIC class methods.

Posted by Peter Judge on 04-Apr-2012 13:37

jjgomez wrote:


Thanks for your sample, At first glance I can see that your code has been taken from a larger context that seems designed to solve this integration problem between SDOs and GUI. Net. Is there any way I can see the full framework you're using? Is this a Progress sample?

That code is some proof-of-concept stuff I did some time ago. It's not a full framework by any means. The important part is that class, which is the shim between the UI requests and the SDO.For updates, look at CommitData() but as Mike says, for any heavyweight work you'll need to have an understanding of the SDO internals.

Like other Progress users (I guess), I am pleased that Progress has opened a way to improve the graphics environments of our applications by integrating .Net, but there is not anything like ADM2 to provide us with a framework to integrate business logic objects, we had developed in ADM2, with the new GUI .Net.

If you think that this sort of functionality would be good to have in the product, I'd further suggest speaking to product management via your rep, and letting them know your use-cases.

-- peter

Posted by jjgomez on 10-Apr-2012 05:51

We have developed different commercial framework solutions that all can be used with ADM2 components in one way or the other. Are you attending the PUG Challenge Americas in May? I could give you a presentation there on our booth.

I would like to see your commercial framework solutions but I don´t will attend PUG Challege Americas.

Not sure if you have found it already, but the sample code is available here: http://communities.progress.com/pcom/message/26470#26470

I will take a look to this sample.

Thanks for your responses to my questions. Anyway, some of those were rhetorical questions raised as try to clarify the magnitude of the problem. I already knew the answers to some simple questions and others, I suspect they have a really complex solution. Certainly I don't know ADM2 in depth among other reasons because Progress does not have a good documentation available on this topic. I have demanded several times to Technical Support on this issue but the response has been that they could help on specific questions but there was no documentation available. Because of this, I really miss that Progress has not provided a framework to help integrate these two environments.

Posted by jjgomez on 10-Apr-2012 06:13

Thanks Peter. You can see too my response to Mike: http://communities.progress.com/pcom/message/153194#153194

If you think that this sort of functionality would be good to have in the product, I'd further suggest speaking to product management via your rep, and letting them know your use-cases.

I'll try, but I think that a solution in this way would come too late for us. We need to do something now.

Posted by Admin on 10-Apr-2012 12:51

I would like to see your commercial framework solutions but I don´t will attend PUG Challege Americas.

Drop me a line at mike.fechner@consultingwerk.de and we'll make up a date for a WebEx.

Posted by jjgomez on 22-May-2012 11:59

How can I add a new record in a form when I have a SDO (with code in addRow function) binding data to a bindingSource (through SDO queryHandle) and this bindingSource binding data to some visual Infragistics controls?

I tested to call addRow function but bindingSource and visual controls don't show the new record.

Posted by jjgomez on 23-May-2012 06:03

Any idea about my previous comment on how to add new records with SDO and BindingSource?


Thanks in advance.

This thread is closed