StrataFrame Forum
Back
Login
Login
Home
»
StrataFrame Application Framework - V1
»
Business Objects and Data Access (How do I?)
»
How To - Completely non-UI use of BOs.
How To - Completely non-UI use of BOs.
Post Reply
Like
0
How To - Completely non-UI use of BOs.
View
Flat Ascending
Flat Descending
Threaded
Options
Subscribe to topic
Print This Topic
RSS Feed
Goto Topics Forum
Author
Message
Alan P Bourke
Alan P Bourke
posted 15 Years Ago
ANSWER
Topic Details
Share Topic
Group: Forum Members
Posts: 7,
Visits: 12
Does anyone have a quick example of how to leverage an BO as defined in an external BO Library from within an non-UI application, such as a Console application ? I presume if the BO is configured and working within it's own BO LIbrary project then I should be able to reference the DLL and use it without having to manually implement SetDataSources et al ?
I can see various postings skirting round the issue on the forum but no concrete examples.
Many thx in advance ...
Reply
Like
0
Trent Taylor
Trent Taylor
posted 15 Years Ago
ANSWER
Post Details
Share Post
Group: StrataFrame Developers
Posts: 6.6K,
Visits: 6.9K
You can most definitely do this and there really isn't much to explain other than the following:
Add a reference to your BO library within your console app
It will also require a reference to the MicroFour StrataFrame Base and MicroFour StrataFrame Business assemblies
Next, you will need to setup your datasources prior to attempting to execute a query on the BO. This is generally done in the program.cs or Appmain.vb files in the SetDataSOurces method in a standard SF app. But all you need to do is setup the datasource manually prior to executing queries on the BO.
MicroFour.StrataFrame.Data.DataBasics.DataSources.Add(New SqlDataSourceItem("","MyConnectionString"))
Reply
Like
0
Alan P Bourke
Alan P Bourke
posted 15 Years Ago
ANSWER
Post Details
Share Post
Group: Forum Members
Posts: 7,
Visits: 12
Thanks. I guess I have a gap in my understanding thus far - I assumed that the BO would know how to connect to the data already without having to set up a data source.
Ah well, onward ...
Reply
Like
0
Greg McGuffey
Greg McGuffey
posted 15 Years Ago
ANSWER
Post Details
Share Post
Group: Forum Members
Posts: 2K,
Visits: 6.6K
The basic architecture allows for BOs to be loosely coupled to the data source. I.e. this allows you to hot swap datasources on the fly as needed (like you might do if you provide online/offline data access or if you have some sort of fall back database server). Also, this allows for many BOs to share the same data source. The datasource encapsulates the connection info, while the BO encapsulates data access and business rules.
Is that making more sense?
Reply
Like
0
Alan P Bourke
Alan P Bourke
posted 15 Years Ago
ANSWER
Post Details
Share Post
Group: Forum Members
Posts: 7,
Visits: 12
Absolutely, thanks Greg.
Reply
Like
0
Greg McGuffey
Greg McGuffey
posted 15 Years Ago
ANSWER
Post Details
Share Post
Group: Forum Members
Posts: 2K,
Visits: 6.6K
Glad it helped!
Reply
Like
0
Richard Keller
Richard Keller
posted 15 Years Ago
ANSWER
Post Details
Share Post
Group: Forum Members
Posts: 84,
Visits: 324
Create a Root Business Object and have all your BO's Inherit from it with your connection string. What we do is provide a utility that sets the Connection although it is in a Non-UI Configuration. The Root BO knows how to connect and cascades down to the LocalHost embedded string if not connected. We also add a few other functions that are used all the time like a FIllAllRecords Data Retrieval Method.
Reply
Like
0
GO
Merge Selected
Merge into selected topic...
Merge into merge target...
Merge into a specific topic ID...
Open Merge
Post Reply
Like
0
Similar Topics
Post Quoted Reply
Reading This Topic
Login
Login
Remember Me
Reset Password
Resend Validation Email
Login
Explore
Messages
Mentions
Search