Need a little Architectural help with an implementation of a business object.
User is presented with a read only list of car options from source A
(display in grid with columns type, column2, column3, column4)
User select a record from list and is presented with:
1. read only list of business object from datasource A
2. read only list of business object from datasource B
3. editable list of business object populated from either datasource A or B
example. All three business object have the same property 'Color'. Datasource A color is Red. Datasource B is Blue. Rules engine returns Blue so 3rd business objects color property would be set to Blue.
Overall this is taking the same object scheme and populating 3 objects from 3 different datasources.
I am just starting out with CSLA and not sure if i need to do this within the Criteria section. If so can someone help with a code sample???
I don't think duplicating the class 3 times just to reference a different datasource is the correct way. right?
sorry, just caught a mistake. the 3 business objects are as follows.
1. read only business object from datasource A ( single record )
2. read only business obejct from datasource B ( single record )
3. editable business object populated from either datasource A or B ( single record)
Sorry, let me see if i can clearify.
User is presented with a grid showing trip information ( trip_number, Service, Time, ) pulled from Database A
User selects a specific trip and is redirected to a reconciliation page.
On page load display 3 columns for compairing Trip_number, Service, and time from data stored in Database A (column A) and Database B (column B). Allow users to choose a value from either Source A or Source B and populate Source C (column C)
Upon completion of the reconciliation update Source C database
My thought was to create a business object ‘Trip’ that has 3 properties (trip_number,service and time)from 3 different data sources.
[readonly] [editable] [readonly]
(Trip A) (Trip C) (Trip B)
Trip # 0956 0956
Service new old
Time 12:00 13:00
After Reconciliation
(Trip A) (Trip C) (Trip B)
Trip # 0956 0956 0956
Service new old old
Time 12:00 12:00 13:00
User select enter and Trip C is saved to the database.
I am new to using CSLA and open to any ideas.
I see what you are doing. However, I am unclear as how to create a Trip object from two different datasources.
In referencing the PTracker code, i see the Fetch method is where one would get a Datareader and loop over that to populate the properties of the object. i need to be able to create this from two or more datasources. this is where i am getting confused. how would i create multiple "Trip" object from different datasources?
I guess i could just create two sets of properties and have two database calls, each of which would populate the appropriate properties. However i think that would be a little slopy. :-(
Thanks to all for the Ideas on the best way to handle this. I have handled this by creating a new Criteria method that will take two paramaters ( tripID, source) then in the Fetch method i conect to the proper datasource based on the source property.
I am just getting started using CSLA and Thanks for all the quick responses.
Copyright (c) Marimer LLC