IEditableBusinessObject (future)

IEditableBusinessObject (future)

Old forum URL: forums.lhotka.net/forums/t/289.aspx


Fabio posted on Tuesday, June 06, 2006

Is possible to add methos to IEditableBusinessObject ?
Methods are:
bool IsNew
bool IsSavable

I need this methos to use them in a base class for Winforms UI
Thanks.
Fabio.

Jav replied on Tuesday, June 06, 2006

Csla.Core.BusinessBase already has IsNew and IsSavable. It implements IEditableBusinessBase.

Jav

Fabio replied on Tuesday, June 06, 2006

I have the last version of CSLA (updated with CVS)
IEditableBusinessBase is not an intefarce of CSLA.
This is IEditableBusinessObject the actual definition of
  public interface IEditableBusinessObject : IUndoableObject
  {
    bool IsDirty { get;}
    bool IsValid { get;}
    bool IsDeleted { get;}
    int EditLevelAdded { get; set;}
    void DeleteChild();
    void SetParent(IEditableCollection parent);
  }
And i think that a complete interface is
  public interface IEditableBusinessObject : IUndoableObject
  {
    bool IsDirty { get;}
    bool IsValid { get;}
    bool IsDeleted { get;}
    bool IsNew { get;}
    bool IsSavable { get;}
    int EditLevelAdded { get; set;}
    void DeleteChild();
    void SetParent(IEditableCollection parent);
  }

I think is better to have a more powerfull control over a BO in a ancestor form and don't need any other modification.
Bye.
Fabio.

Jav replied on Tuesday, June 06, 2006

Sorry, I wrote it wrong.  Here is waht I meant to say:

"Csla.Core.BusinessBase already has IsNew and IsSavable. It implements IEditableBusinessObject."

In other words, you might want to subclass your classes from Csla.Core.BusinessBase.  You will then have the functionality of IEditableBusinessObject Plus IsNew and IsSavable.

Jav

Fabio replied on Tuesday, June 06, 2006

I know that i have both method implemented in BusinessBase but i need the interface... i hope you know for what....
In my base form classes i work with interfaces, i prefer work whit interfaces instead concrete classes.
Bye.

xal replied on Tuesday, June 06, 2006

Fabio,
This is not exactly what you're looking for, but it'll solve your specific problem and more...
http://forums.lhotka.net/forums/thread/341.aspx

Andrés

Fabio replied on Tuesday, June 06, 2006

Oh yes..
I tried to use generic in a form but ... you know the problem....
Now i have better form that work with interfaces so my forms can work with or without CSLA ;)
Thanks for the link is important to know it.
I hope that microsoft it fixes it, in a soon future, without the use of makes up.
Bye.

RockfordLhotka replied on Wednesday, June 07, 2006

This will be in 2.0.2.

Fabio replied on Wednesday, June 07, 2006

Thanks Roky!
I just get it ;)
Fabio.

Copyright (c) Marimer LLC