Evaluating, Running DevExpress samples


Author
Message
Trent Taylor
Trent Taylor
StrataFrame Developer (10K reputation)StrataFrame Developer (10K reputation)StrataFrame Developer (10K reputation)StrataFrame Developer (10K reputation)StrataFrame Developer (10K reputation)StrataFrame Developer (10K reputation)StrataFrame Developer (10K reputation)StrataFrame Developer (10K reputation)StrataFrame Developer (10K reputation)
Group: StrataFrame Developers
Posts: 6.6K, Visits: 6.9K
Is there a nice way of implementing inheritance between BOs? For instance could we have a Customer BO and an Employee BO both having a Contact BO as a parent? It would save redundant code and BOs.

Yes, this is definitely possible and also recommended in many cases.  However, in this example I would take a different approach.  In our medical application, we have the same need.  We have patients, insurance carriers, service facilities, etc. wll that have the need for unlimited phone numbers and others with the need for multiple addresses.  In this case you are better off creating a table called PhoneNumbers and another called Addresses (you could combine them if you need to).  Then create a type field that is represented by an enum in the BO.  This way you can have as many addresses and phone numbers for as many different tables that are necessary.  You can then create a custom property on each of the BOs that returns the primary phone/address, secondary phone/address, etc.  This is a much cleaner avenue to travel.

You can then create a base BO that all of theses BOs can inherit that has the logic to pull the address/phone number from the PhoneNumbers and Addresses table so you only have to program this logic once.

Example Phone Numbers Table Structure

ph_pk - BigInt (Primary Key)
ph_ParentPk - BigInt (Parent Foreign Key)
ph_ParentType - Int (Determines the parent table type - Patients, Customers, Carriers, etc.)
ph_Type - Int (Home, Work, etc.)
ph_Rank - Int (Allows the end-user to rank the phone number in order of most reachable)
ph_PhoneNumber - VarChar (Phone Number)

(I think that you get the idea)

Then create a base BO that each of these inherit that implements the logic to pull from this table:

Very Simple Example of a Base BO

Public Class MyBaseBO
     Inherits MicroFour.StrataFrame.Business.BusinessLayer

Public Property PrimaryPhoneNumber As String
    Get
        '-- Place your logic to pull from the Phone Numbers Table
        Using bo As New PhoneNumbersBO
            '-- Retrieve the TOP phone number
            bo.FillWithPrimaryPhone(parentType, primaryKeyOfParentRecord)

            If bo.Count > 0 Then
                Return bo.ph_PhoneNumber
            Else
                Return String.Empty
            End If
        End Using
    ENd Get
    Set (ByVal value as String)
        '-- Parse the passed string and update the Phone Numbers table (if necessary...you can also make this property
        '    read-only so that it only supports the Get
    End Set
End Property

End Class

Inherit off of that BO

Public Class Customers
    Inherits MyBaseBO

End Class

Note: When you change the inherits of a BO, just change it in the main file (MyBo.vb) and not the designer file (MyBo.Designer.vb).  The inherits is only in the main file so that when the BO Mapper builds the partial class, it doesn't override the inherits statement.

Greg McGuffey
Greg McGuffey
Strategic Support Team Member (3.3K reputation)
Group: Forum Members
Posts: 2K, Visits: 6.6K
My first thought is that you'd do this at the db level. I.e. generalize you table design. Then, you'd just have a straight forward translation of tables to BOs. I'll be interested to see if there are other ways of handling this though!
George Nentidis
George Nentidis
StrataFrame User (136 reputation)StrataFrame User (136 reputation)StrataFrame User (136 reputation)StrataFrame User (136 reputation)StrataFrame User (136 reputation)StrataFrame User (136 reputation)StrataFrame User (136 reputation)StrataFrame User (136 reputation)StrataFrame User (136 reputation)
Group: Forum Members
Posts: 72, Visits: 251

Since we're working more and more with the framework, more complex issues arise.

Is there a nice way of implementing inheritance between BOs? For instance could we have a Customer BO and an Employee BO both having a Contact BO as a parent? It would save redundant code and BOs.

For instance a Contact could have multiple addresses. So we need a Contact BO and an Address BO connected with owner-child relationship. A Customer could also have multiple addresses. So we need another Address BO to connect it with the Customer BO. If we need to implement this with Employees too, then we would need  a third Address BO to connect it with the Employee BO. This would result in three Address BOs having the same implementation.

But if both Customer and Employee have Contact as their parent, then we would need a single Address BO, connected with the Contact BO, and inherit this connection.

 

So, do you think this inheritance between BOs is possible?

 

Thank you for your time...

George Nentidis

Trent Taylor
Trent Taylor
StrataFrame Developer (10K reputation)StrataFrame Developer (10K reputation)StrataFrame Developer (10K reputation)StrataFrame Developer (10K reputation)StrataFrame Developer (10K reputation)StrataFrame Developer (10K reputation)StrataFrame Developer (10K reputation)StrataFrame Developer (10K reputation)StrataFrame Developer (10K reputation)
Group: StrataFrame Developers
Posts: 6.6K, Visits: 6.9K
Glad you found the property Smile
George Nentidis
George Nentidis
StrataFrame User (136 reputation)StrataFrame User (136 reputation)StrataFrame User (136 reputation)StrataFrame User (136 reputation)StrataFrame User (136 reputation)StrataFrame User (136 reputation)StrataFrame User (136 reputation)StrataFrame User (136 reputation)StrataFrame User (136 reputation)
Group: Forum Members
Posts: 72, Visits: 251
False alarm!

I have found the DataSourceKey property on the BO's designer.

George Nentidis
George Nentidis
StrataFrame User (136 reputation)StrataFrame User (136 reputation)StrataFrame User (136 reputation)StrataFrame User (136 reputation)StrataFrame User (136 reputation)StrataFrame User (136 reputation)StrataFrame User (136 reputation)StrataFrame User (136 reputation)StrataFrame User (136 reputation)
Group: Forum Members
Posts: 72, Visits: 251
Ok, the whole thing worked well with CAB too. I only had to make a few changes in CAB since both CAB and Strata need to create the application's main window on their own.

As for the DataSources.

I try to skip the ConnectionManager wizard, and read a connection string from a configuration file. I add a few connection string in the DataLayer.DataSources collection. When using a BO I set the DataSourceKey property and it works ok. When populating a grid with a BO, the grid create a BO instance on its own. How can I set the DataSourceKey for that instance to? The PopulatationDataSourceSettings property does not have property for that. I set the DataSourceKey at the BO's contructor. Is there another preffered way?

Thank you for your help.

George Nentidis

Trent Taylor
Trent Taylor
StrataFrame Developer (10K reputation)StrataFrame Developer (10K reputation)StrataFrame Developer (10K reputation)StrataFrame Developer (10K reputation)StrataFrame Developer (10K reputation)StrataFrame Developer (10K reputation)StrataFrame Developer (10K reputation)StrataFrame Developer (10K reputation)StrataFrame Developer (10K reputation)
Group: StrataFrame Developers
Posts: 6.6K, Visits: 6.9K
Are you familiar with CAB? Do you work with CAB? Any of your customers do? Do you think we might have any problems with that?

StrataFrame will work with the CAB (Composite UI Application Block for those who are wondering) as it is written in .NET 2.0.  We do not spend a lot of time in it nor does anyone that comes to mind at the moment.  However, I can tell you from vast experience how to create user controls and then implement that SF user control in another environment that it works quite well. 

If you run into the need to use the BOTranslations in a situation where a user control is dropped on another user control before the next update, let me know.  We have recently made some changes to the BOTranslations as is relates to the user control which allows the translations to nest themselves inside of other controls rather than on a form.  You will know pretty quick if you run into.  In that instance I can post the assemblies for you.  We are planning to get a new update out fairly soon so it may end up being a mute point.

George Nentidis
George Nentidis
StrataFrame User (136 reputation)StrataFrame User (136 reputation)StrataFrame User (136 reputation)StrataFrame User (136 reputation)StrataFrame User (136 reputation)StrataFrame User (136 reputation)StrataFrame User (136 reputation)StrataFrame User (136 reputation)StrataFrame User (136 reputation)
Group: Forum Members
Posts: 72, Visits: 251

Thank you all for your responses.

I have managed to solve most of the problems real fast. And I can see that with StrataFrame we can work really fast and focus on our business logic. If it all prooves to be quite stable in time, it is going to be a huge relieve.

Another thing I am trying to solve now is the cooperation of StrataFrame with CAB. The only issues I can see is that CAB works with UserControls instead of forms. This should be easy since StrataFrame has already an SF UserControl template.

Also the Application object is different. CAB required application objects to inherit from certain classes, while Strata needs some events and methods.

Are you familiar with CAB? Do you work with CAB? Any of your customers do? Do you think we might have any problems with that?

Thank you once again

George Nentidis

Trent Taylor
Trent Taylor
StrataFrame Developer (10K reputation)StrataFrame Developer (10K reputation)StrataFrame Developer (10K reputation)StrataFrame Developer (10K reputation)StrataFrame Developer (10K reputation)StrataFrame Developer (10K reputation)StrataFrame Developer (10K reputation)StrataFrame Developer (10K reputation)StrataFrame Developer (10K reputation)
Group: StrataFrame Developers
Posts: 6.6K, Visits: 6.9K
. I intend to use BOs with DevExpress grid, for editing them. Is there going to be any problem with that? Are there any limitations or issues that I need to be aware of?

We have a control called the BusinessBindingSOurce which allows you to wrap a business object and then interact with any 3rd party control, include a grid, without issue.  The BBS allows you to attach an SF BO to the grid as a native .NET data source. 

Can I use BOs with SQL 2005 Reporting Services? Either for local or server rendering?

Yes.  The same will be true with the SQL reporting services.  We have a number of developers who use the SQL Reporting Services and there are a number of different ways to use an SF BO with the reporting services as well.

George Nentidis
George Nentidis
StrataFrame User (136 reputation)StrataFrame User (136 reputation)StrataFrame User (136 reputation)StrataFrame User (136 reputation)StrataFrame User (136 reputation)StrataFrame User (136 reputation)StrataFrame User (136 reputation)StrataFrame User (136 reputation)StrataFrame User (136 reputation)
Group: Forum Members
Posts: 72, Visits: 251
Ok, those issues have been solved. Thank you for your response.

I have managed to run the samples and make some of my own. I have used Enhanced List. Some things that I need to ask are:

1. I intend to use BOs with DevExpress grid, for editing them. Is there going to be any problem with that? Are there any limitations or issues that I need to be aware of?

2. Can I use BOs with SQL 2005 Reporting Services? Either for local or server rendering?

Forgive me if those questions are all somewhere in a manuall already answered.

George Nentidis.

GO

Merge Selected

Merge into selected topic...



Merge into merge target...



Merge into a specific topic ID...




Similar Topics

Reading This Topic

Login

Explore
Messages
Mentions
Search