|
Your business layer should definitely be operating on your business/domain objects. The general principle here is that the your domain objects are abstracted away from the storage mechanism.
If you are using DTOs, then to keep this abstraction going, its fairly likely that your DTOs will be closer to your domain objects than the storage mechanism. This brings up the obvious idea that since your DTOs look so much like your domain objects, then lets give the DAL the capability of acting on your domain objects directly.
Now you are entering ORM territory, and if you don't mind me saying so I think our product Diamond Binding[^] does this quite well.
In regards to performance, a naive DAL implementation is going to be slower than, say, ad-hoc queries to the database. Even a highly optimised commercial OR Mapper like Diamond Binding is going to be slightly slower when performing trivial operations (insert single record, etc). Where you gain a lot of performance back is when you are performing more complex operations.
"Invoice.Load(34);" may not appear to be doing much on first glance, but theres huge gains that can be made here when your DAL is fully aware of the relationships in your domain model. DB will pull the invoice back, making some intelligent decisions about joins, and you'll have the invoice34.Customer and the invoice34.lineItems[] as well, in one round trip. Theres similar gains with mature caching strategies as well.
Anyway, yes a generalized DTO is realized by eliminating it A DAL that's aware of the domain model can act on your business objects intelligently, and pick the most optimal strategy for the particular action you are requesting. (And my biased opinion is that its much easier to use an off the shelf one than trying to write one yourself
|
|
|
|
|
Thanks mark for valuable post. Thanks again.
|
|
|
|
|
i have cooencted a access fron end with a sql backend.
what sort cursors are used?
Is it client side or server side?
|
|
|
|
|
That depends entirely on your connection and the way you interact with it.
|
|
|
|
|
None if you can help it. Cursors are sometimes a necessary evil (thier performance is not great and thier logic (procedural) is in conflict with the set based nature of SQL), but you should first try REAL hard to avoid using them.
Not to steer you away from this wonderful site and its knowledgable participants, but you may get more specialized assistance with your question at a place like sqlservercentral.com.
|
|
|
|
|
That's not what he's talking about. He's talking about a client-side versus a server-side cursor. This was more of an issue with old ADO code than ADO.NET.
|
|
|
|
|
I am using SSRS 2005. I can fetch report from remote reporting server. But user can access there reports. I mean, User can only access reports that are part of their logged on credentials (role). Help please.
|
|
|
|
|
see the URL: http://msdn2.microsoft.com/en-us/library/ms157198.aspx
Kishore.P
|
|
|
|
|
Hi,
I am using SSRS 2005. I used charts to show the report. I have to change the chart types at run time basesd on the option. User can select any chart eg. bar chart, pie chart, column chart etc. On selection screen should populate the chart type. I am not able to change chart type at runtime. Help please.
|
|
|
|
|
You can't change the chart type of a chart at runtime. What you can do is have a number of chart controls on your report, each one configured for a different chart type. At runtime, change the visibility property of each chart control so that only the type that the user has selected is displayed.
Paul Marfleet
"No, his mind is not for rent
To any God or government"
Tom Sawyer - Rush
|
|
|
|
|
Is it possible to install MS SQL Server 2000 on Windows XP Professional so that i have a local, independent database on that particular PC? The idea is to have a local database for use on that PC.
PS: Installing MS SQL Server 2000 on Windows Server 2003 gives me the local database.
Is it that MSDE is the only way(of the two) to have a local database??
|
|
|
|
|
There is a special edition of SQL server 2000 which will run on Windows XP. It is the SQL Server Developer Edition.
Wout Louwers
|
|
|
|
|
What about MS SQl Server 2005 Express and Enterprise editions?? Can they also be used for local database??
|
|
|
|
|
The express edition can be installed on XP. But you did ask about SQL Server 2000!
Wout Louwers
|
|
|
|
|
Yeah true. My last question was in addition to the prevoius one.
You clarified my doubt on SQL 2000. Now, again, I wanted to know the same for for SQL 2005 Express as well as Enterprise editions.
Thanks.
|
|
|
|
|
SQL Express works fine on XP. So does SQL 2005 standard. The only problem with SQL Express is the number of connections (5 If I remember correctly.) Also Express does not have fun things like SSIS or SSAS. It does have the reporting service. SQL Express is free to download.
WPWood
|
|
|
|
|
What do you mean by local database? Is it a database that you can access only from the computer where the server is installed?
|
|
|
|
|
|
Hi,
I'm appending data to a table with the INSERT INTO command. I am also operating on the same table with recordset commands .MoveFirst and .Find
What I am noticing is that my INSERT commands are not immediately recognized until I close the table...
Is there a way to make my INSERT commands stick right away?
I'm working in VBA/Access through a user form and two tables that support it. I'm probably talking above the specifics, but this is what appears to be happening in my problem.
Thanks,
Johnny
|
|
|
|
|
addendum:
I am doing the INSERT INTO tbl_Defects followed by the .MoveFirst and .Find commands (in that order.)
What seems to be failing is the .Find (the INSERT INTO didn't refresh the table???)
Thanks.
|
|
|
|
|
john john mackey wrote: What seems to be failing is the .Find (the INSERT INTO didn't refresh the table???)
What is probably not refreshed is the recordset...
|
|
|
|
|
I have a column called AUDIT_EVENT_DATE that is a DATETIME stamp for when an event occurred. I'm trying to put a query together that lets me see only the records for events that occurred between 18:30 and 18:45 for the last two months.
select to_char(audit_event_date,'DD-MON-YYYY HH24:MI:SS') from transaction_audit
where trunc(audit_event_date) > to_date('01-OCT-2007','DD-MON-YYYY')
and audit_event_date between to_date('18:30:00','HH24:MI:SS') and to_date('18:45:00','HH24:MI:SS')
order by audit_event_date The above only supplies me with audit records dated on November the 1st. I think that's because of a truncation thing that is happening. Wouldn't it be nice if there was a handy function called TIME_only, and then I could do this instead
select to_char(audit_event_date,'DD-MON-YYYY HH24:MI:SS') from transaction_audit
where trunc(audit_event_date) > to_date('01-OCT-2007','DD-MON-YYYY')
and time_only(audit_event_date) between time_only(to_date('18:29:59','HH24:MI:SS')) and time_only(to_date('19:00:00','HH24:MI:SS'))
order by audit_event_date
Anybody have any ideas of how to do this? Thanks.
|
|
|
|
|
Hi Chris. How about:
to_char(audit_event_date, 'HH24:MI:SS') between '18:29:59'
and '19:00:00' Also (if I remember my Oracle SQL correctly) you can use "trunc(date) to remove the time component from datetime fields.
Regards
Andy
|
|
|
|
|
Thanks Andy. I couldn't see the forest for the trees. That worked perfect for me.
|
|
|
|
|
Hello All,
I am looking for a little assistance with a problem I am having. We have been adding new users to our database as needed without issue; the problem begins when I have to assign permissions to all of the stored procedures in a db for that user. I know the command to give the user Execute permissions but I have to do it procedure by procedure.
Isn't there a simpler way of scripting this to grant execute permissions to all of the procedures?
Any help would be greatly appreciated.
F.Fowler
|
|
|
|