Hi,

I was wondering if someone here has some experience with the deployment of a winform application which depends on DO4.0? Are there any special things I should take into account?

Do I need to install DO4.0 onto the target machine or is adding the required assemblies into the GAC enough?

Hopefully someone can help me...

Regards, Martijn


Updated at 08.12.2009 20:49:03

Hi,

Thanks for the reply, I did some setup building today with the standard setup projects shipped with vs2008 and things seem to work fine. Tomorrow I do some more advanced setup building based InstallShield.

Btw, how do you deal with data binding on WindowsForms? Currently we support just WPF interfaces (INotifyXxx), there is no support for WF interfaces (IBindingList, IEditableObject, etc.) so far.

Well I must say and not very good at designing client interfaces, not my core business :D
For this project I use DevExpress components in my WindowsForms and custom IBindingLists, IEditableObjects which are set as the datasource for the grids, comboboxen, etc I use to show output to the user.

Or is this not what you mean?

Regards


Updated at 09.12.2009 22:23:03

Ok for example,

I have a lookup edit (DevExpress component) which has a so called datasource propertie

lookupedit1.datasource = myservice.getCountries();

myservice looks like this,

public class myservice:sessionbound
{
     public List<string> GetCountries()
     {
          List<string> result = new List<string>();
          var countries = Query<Country>.All;
          foreach(var cnt in countries)
          {
              result.add(cnt.name);
          }
           return result;
     }
}

For textbox binding I do the following,

var myObject = myservice.GetObjectDetails(code);
textbox1.text = myObject.Name;

public class myservice:sessionbound
{
     public myObject GetObjectDetails(string code)
     {
          return (from o in Query<myObject>.All
                   where o.code == code
                   select o).Single();
     }
}

I track the text changes made by the user by setting a boolean value, if the value is true then text is changed by the user. When the user saves his changes I again call myservice. See example

public class myservice:sessionbound
{
     public bool Update(myObject, string code, string name)
     {
          var o = myObject;
          o.code = code;
          o.name = name;
     }
}

I know this is not the most fancy way but It works for me for now. I due hope proper winform binding is implemented in a later release of DO4.0

This any help??


Updated at 10.12.2009 21:19:04

About binding for WindowsForms: are there any issues we can eliminate quickly? I.e. what would you like to get ASAP here?

At this point I don't have any major issues regarding binding objects within my application...because I don't use IBindingList, IEditableObject, etc. But I will do some research regarding binding doa objects to WindowsForms the upcoming day's. Will keep you posted.

Regards


Updated at 15.12.2009 10:56:26

Ok I did some searching on the internet about IEditableObject, INotifyPropertyChanging, INotifyPropertyChanged and come across a nice article by Paul Stovell, http://www.paulstovell.com/editable-object-adapter This article talks about a wrapper around a "data-bound object".

But would it work on DOA object?? Well I think it does..with some alterations, mostly error catching :D

The attached file contains a project with winform bindings, check it out and see if this is what you mean. I hope this will help you develop winform bindings support in DOA4.0

Regards, Martijn


Updated at 16.12.2009 15:35:34

Let me do some more testing regarding

  • Base -> Adapter<base>
  • Descendant -> Adapter<descendant>

I think modifing the properties of a Descendant through a adapter<base> is going to difficult...maybe imposible, will keep you posted.

Btw what do you mean by

but earlier we didn't invent a "complete" way allowing to adopt it here, and, likely, because of that we didn't try to evaluate it.

Cheers

This thread was imported from our support forum. The original discussion may contain more detailed answer.

asked Dec 07 '09 at 18:36

Martijnvl's gravatar image

Martijnvl
21555


One Answer:

> Do I need to install DO4.0 onto the target machine or is adding the required assemblies into the GAC enough?

You should simply keep them in .bin folder (earlier this was possible too, but now this is exactly what you get after building the solution). There is no install to GAC starting from ~ v4.1.

So basically, DO4 is deployed with your application as any other library. All the assemblies is is composed of must be simply available in app. folder or GAC.

Btw, how do you deal with data binding on WindowsForms? Currently we support just WPF interfaces (INotifyXxx), there is no support for WF interfaces (IBindingList, IEditableObject, etc.) so far.


No, I mean how do you bind DO4 objects to WindowsForms UI controls? Actually we even didn't try this yet, that's why I'm 99% sure there must be various issues.

And that's why I'm asking you about the way you use. If it's good, likely, we must try to adopt/support it. But if it's not good (e.g. it relies on some misguided DO4 usage), you will know the issues to fix\resolve\modify.

v4.0 is relatively new and not well documented so far (e.g. best practices are mainly shown for ASP.NET apps), so asking you is the best way to improve the product and increase satisfaction of its users :)


Yes, this must work - good that you use this approach. DisconnectedState we're finishing now (we need ~ a week) will help to solve all the potential problems here (the main one is that transactions in your case are created either much more frequently than it's necessary, or you use a long-running one). You won't need to do a lot of changes - basically, DisconnectedState just changes the behavior of Session when it's attached to it, and the new behavior is nearly what you expect in case with WPF/WF.

About binding for WindowsForms: are there any issues we can eliminate quickly? I.e. what would you like to get ASAP here?


We'll definitely check this. We thought about adapters, but the main concern here for us was inheritance:

  • Base -> Adapter<base>

  • Descendant -> Adapter<descendant> (or Adapter<base>? If so, how can we modify the properties of Descendant through it?)

Let's imagine there is Referrer type containing a Reference to Base. So what is the type of this property in Adapter<referrer>? If it is Adapter<base>, we can't assign Adapter<descendant> to it.

But anyway, we must look up the code first... The idea seems good in general, but earlier we didn't invent a "complete" way allowing to adopt it here, and, likely, because of that we didn't try to evaluate it.


> Btw what do you mean by ...

I thought about similar way, but as I discovered this issue with inheritance, I stopped its evaluation - I'm an idealist...

Btw, may be co\contravariance in .NET 4.0 will allow to get rid of it gracefully (I'll think about this).

answered Dec 08 '09 at 18:09

Alex%20Yakunin's gravatar image

Alex Yakunin
29714412

Thanks - I'll be glad to hear this.

(Dec 08 '09 at 18:09) Alex Yakunin Alex%20Yakunin's gravatar image
Your answer
Please start posting your answer anonymously - your answer will be saved within the current session and published after you log in or create a new account. Please try to give a substantial answer, for discussions, please use comments and please do remember to vote (after you log in)!
toggle preview

Subscription:

Once you sign in you will be able to subscribe for any updates here

Tags:

×573

Asked: Dec 07 '09 at 18:36

Seen: 3,456 times

Last updated: Dec 07 '09 at 18:36

powered by OSQA