|
..Hubert.. wrote: Best choice for me is the fourth one - dynamic SQL which is build during app's runtime with all the filters taken from UI, with all the order clauses needed, with paging etc..
Why is that "Best choice" rather than Stored Procedures and SqlCommand approach?
|
|
|
|
|
I really hate writing stored procedures
Small or mid projects are almost always not well specified which means, that there's huge risk of changes.
With ORM approach you can just add new properties to your objects then add new fields to tables and you're ready to go (yeah, most of them arent't so easy, but let's assume they are).
With SPs you have to change tables, SProcs and loading code. There's one more catch-up - deployment.
That's why I prefer ORMs in small apps.
However I've got one question - how do you write SPs which returns lists of objects with pagination and order passed from UI?
|
|
|
|
|
..Hubert.. wrote: how do you write SPs which
I am not a DBA. If you are serious about that question try asking in the SQL forum. I think there are some pretty sharp people in there.
So your answer to my question is "changes"? And there are less changes using embedded SQL than using stored procedures? In my experience I have not found that to be true.
Also your first post states that you want to use dynamic SQL (embedded SQL) and the last one talks about ORM. Which is it?
|
|
|
|
|
you could try mixing it up a bit. i'm trying diamond binding (dunnchurchill.com) at the moment (some guy on here suggested it recently), which takes care of the data-end really well. seems to be based on nhibernate - and you can do custom mappings manually using attributes.
it doesnt do the gui side though, but i've found the data layer it creates is really clean, so you could use whatever tool you wanted (i'm just using the inbuilt databinding in VS). not sure if anyone can suggest a good business object to gui framework?
|
|
|
|
|
I've written a synth toolkit in C#. I'm adding the capability to record the output as a wave file. I'm trying to nail down the design for doing this. Here's the approach I currently have implemented:
- User hits record (a check box with a button appearance).
- Synth engine begins recording output memory
- User hits record a second time
- Synth engine stops recording
- User is prompted and asked if he/she wants to save the wave data
- If user says yes, the user is prompted for a file name, and the wave data in memory is saved to disk
- If user says no, wave data is cleared
The problem with the above is that wave data takes up a lot of memory. If the user wants to record for say an hour or so, he/she could run out of memory. I found this out when I forgot to stop recording and ate dinner. When I came back, the computer was slugish due to low memory.
So I was thinking that a better approach would be to record directly to disk:
- User hits record (a check box with a button appearance).
- Synth engine begins recording output to a temporary file
- User hits record a second time
- Synth engine stops recording
- User is prompted and asked if he/she wants to save the wave data
- If user says yes, the user is prompted for a file name, and the temporary file is renamed to the new name
- If user says no, the temporary file is deleted
Perhaps I should set a limit on how large a file is acceptable so that it's not possible for the program to use up all available disk space. Hmm, maybe I could use that approach for recording to memory instead?
Any thoughts? Details I may be overlooking?
|
|
|
|
|
Hi Leslie,
I would suggest you add an options dialog, that lets the user choose the maximum capture
period (say radio buttons for 10 sec, 1 min, 10 min; or a textbox); then have the record
button record to memory for that time (or until clicked again), then do the save/saveto
dialog stuff you described.
I would not automatically save to temp file on disk, unless you take some precautions
limiting both the size and the number of such files; without limits, you may find yourself
cleaning up the disk quite often.
|
|
|
|
|
Luc Pattyn wrote: I would suggest you add an options dialog, that lets the user choose the maximum capture
period (say radio buttons for 10 sec, 1 min, 10 min; or a textbox); then have the record
button record to memory for that time (or until clicked again), then do the save/saveto
dialog stuff you described.
That sounds excellent. Will do. Thanks!
|
|
|
|
|
Glad to help.
The more challenging option could be: record for ... sec/min
or [checkbox] until 3 sec of silence occurs.
|
|
|
|
|
Also, you could add in support for both. This way for people who wish to record large amounts they have the option of recording to hard disk. But also include a restraint option in the config dialog similar to what you'll have for in memory recording.
This statement was never false.
|
|
|
|
|
Hello guys, i'd like to implement the undo and redo function(like Undo and Redo in MS Word) by combination Command and Memento design pattern. I've found a quite useful article about this but it did not mention Memento.Can anyone tell me how to combine these two design pattern?I've also searched around but these articles are either about Command or Memento not both of them.
Thank you
|
|
|
|
|
It's not common to combine the two patterns to perform Undo/Redo. I would suppose that you would need to identify against each action whether or not it was specified with a Memento or a Command. This is not a good design.
Deja View - the feeling that you've seen this post before.
|
|
|
|
|
Had this question in the wrong forum.
I'm at a breakpoint with my architecture and could use some guidance in finishing up my vision. I will give a rundown of the current architecture so far:
This is a plug-in architecture, that automates the loading and un loading of plug-ins for the users and developers. By using a defined interface and custom attributes my architecture will auto load plug-ins without the use of ini files or configuration files.
The current issue I have is security and applying security filters to screens as they display. What basically will happen is an admin will setup security and access points for roles. Roles are then assigned to a user. What I need is to be able to disable, hide, unhide or re-enable elements on the form at the time the page is loaded based on that users security role. This is simple if I have every developer call a set of security procedures, but what I want is the framework to automatically do this for the developer.
The one idea so far is the use of “Application Event Handler” which is looking for a certain windows message to be sent.
I was wondering if anyone else had any other ideas that might be worth looking into. ( IE: any patterns or such)
Thanks for the Help.
Sal
|
|
|
|
|
ssack wrote: IE: any patterns or such
Have you had a look at the Portland Pattern Repository?
|
|
|
|
|
No i have not, thanks for the heads up and i will take a look.
|
|
|
|
|
Hello,
I have drawn some diagrams in Rational Rose 4.0, now i want to generate code from these diagrams. anyone who has already done this, please guid me how to generate.
Thank You
Qaiser Nadeem
Regards, Qaiser Nadeem
|
|
|
|
|
FishiFishi wrote: I have drawn some diagrams
Class Diagrams? That is what the code is generated from.
FishiFishi wrote: please guid me how to generate.
Use the "Rational Rose Help" if you don't know where in the menu items to go.
|
|
|
|
|
I'd suggest asking on Ibm's rose forum.
http://www-128.ibm.com/developerworks/forums/dw_forum.jsp?forum=332&cat=24[^]
--
You have to explain to them [VB coders] what you mean by "typed". their first response is likely to be something like, "Of course my code is typed. Do you think i magically project it onto the screen with the power of my mind?" --- John Simmons / outlaw programmer
|
|
|
|
|
Hallo,
my company works on Rational Suit 2003
if you created the class digram, you should open it then go to tools menu,and select the programming language, then you can see the Create Code option, select it, so the code will be generated if there is no errors in your digram.
Best Wishes, Good Luck
Eng. Mai...
|
|
|
|
|
We have a section of our application that deals with reporting, using MS reporting services. We also have a custom data extension that performs some post processing on the datasets returned (basically stripping out records that the runtime user would not be authorised to see).
The current method we are using is to run the sql, generate a dataset, check to see if it contains sensitive data (looking at column names) and then loop through the rows, removing those that are not required.
Obviously, this is a lot slower than it would be to just alter the sql to remove these rows using criteria in the where clause, but we can't see a way to robustly parse the sql to establish
A) That the query is actually accessing sensitive data.
B) Where we can insert our chunk of sql into the where clause.
For simple reports, this is relatively easy, but as some of the reports are considerably more complex and the sql will contain calls to functions and in some cases creating temp tables, it rapidly becomes more complex.
So, the question - does anyone know of a robust method of taking a string of arbitrary sql and parsing to allow us to alter the where clause of whichever part of it returns data?
|
|
|
|
|
I don't have a real solution for your problem but a simple idea.
After reading your message I assume that you know the structure of the result (schema).
Therefore it should be possible to wrap your query:
select <only permitted="" columns="">
from <the original="" query="">where <additional restrictions="">
This way you can get rid of the unwanted data on the db server.
-^-^-^-^-^-
no risk no funk
|
|
|
|
|
No, and this is really the problem, the sql that we are passed could contain largely anything.
|
|
|
|
|
morning all (or afternoon/evening depending where you are....)
I'm not sure if this is the right place to ask, I think it is, but feel free to move it mr(s) admin if need to be to somewhere more appropriate.
I was really just after peoples thoughts, so here goes....If I have a page/area divided up into subareas but these are changeable in size what would be the best way to do it? I was thinking originally about just drawing lines (having the x/y of the start point and the length), but then throught its not really the line I'm interested in but the area it encloses so I suppose I would want to be able to draw boxes (similar to divs in a webpage is the best way of decribing it, its basically for laying out information within the application but allowing the user to resize areas) so I would need x/y and w/h. Would that be a more sensible approach ? Or ...(and heres hoping is there something already within the windows api that would handle this - some sort of table type structure would probably do it, just so long as i could return the values of each of the cells. Could I do something with multiple panels maybe, I'd need to maintain the coords etc of them but at least that would give me something *physical* to work with, suppose I should go and play around a bit and see what comes of it.
anyway, like I said it was really just to see if anyone thought I was barking up the wrong tree, had completely missed something that was out there or thought maybe i was going in the right direction.
cheers
tim
|
|
|
|
|
You don't say what you're using. In WinForms, .NET 2.0, you can use a nested set of SplitContainer controls to host whatever else you need in the divisions you mention.
|
|
|
|
|
hi brady
sorry, i suppose that might have helped....doh!
SplitContainer controls sound exactly like the thing I was after, I knew there'd be something rather than me bodging in some sort of tawdry effort that only kind of half works.
thanks for the pointer
tim
|
|
|
|
|
I was arguing with my friends about sending the business object over a web service.
Some of my friends said that they don't pass the busineess object (eg: Employee ) to Webservice. Instead, they used to pass the individual parameter (eg: empId, empName, empAddress ) to WebService. Because they think that sending the business object over a webservice is not good practice.
I don't understand why this is not good practice. I used to send the custom business object to webservice in several project. It works fine.. Plus, it's so easy if I wanna add some properties (eg: empPhone, empEMail ) to my business object because I dont need to add the individual parameter in each and every webmethods whenever I made changes to my BO.
I'd like to hear your opinion about this. What do you think?
Thanks in advance.
|
|
|
|