|
nstk wrote: having each more or less 300 stored procedures! ..it can hold lots more.
nstk wrote: as they do not contain any object oriented thinking And why is that a problem?
nstk wrote: in the end we have a procedural code like in the days of old good C. C and TSQL are different beasts.
nstk wrote: We have to deal with lots of bugs, which is not sure whether they come from
backend (MSSQL) or the frontend (Windows App in C#) Simple; if it is raised after executing a query, it is in the database. With sprocs it is even easier to verify as one only has to check the parameters.
A good way would be to have error-handling in the sproc, and rollback any changes if there's an error, and raising your own custom error that gets handled and logged by the C# code. There's examples on this site on how to do so.
nstk wrote: Are there any other solutions to avoid so much SPs and still have a professional
code? Yes, the alternative is to use inline SQL. That'll be even harder to debug.
nstk wrote: I thought of exchanging SELECT SPs through Views A view is nothing more than a SELECT statement. You can create 300 views, but they would not be very object-oriented. You also cannot pass a parameter to a view like one could with a sproc. Finally you could execute the select directly from code, without any views or sprocs - but that would be rather dirty.
SProcs are the professional way.
Bastard Programmer from Hell
If you can't read my code, try converting it here[^]
|
|
|
|
|
I can't see what problem you're trying to solve, other than to arbitrarily re-factor your application's architecture.
Do you have a specific issue with these backend stored procedures? from what you have described here, I can't see any problem. Database servers can easily handle hundreds of stored procedures. There are also huge benefits to using stored procedures such as performance and load balancing.
If you are experiencing specific problems then please describe what they are.
"There are two ways of constructing a software design: One way is to make it so simple that there are obviously no deficiencies, and the other way is to make it so complicated that there are no obvious deficiencies. The first method is far more difficult." - C.A.R. Hoare
Home | LinkedIn | Google+ | Twitter
|
|
|
|
|
I'm trying to figure out to use System.Threading.Tasks.Task asynchronicity in conjunction with waiting for Win32 HANDLE triggering.
Summary:
I'm interfacing with an unmanaged DLL which communicates with a data collection device. ([DllImport("xxx.dll", CallingConvention = CallingConvention.Cdecl, ...] on each unsafe method.)
One of the methods will acquire N data records asynchronously into a user supplied buffer. Specifically, it "spawns the data read on a background thread", and returns a HANDLE to wait on for completion.
There is an additional method which will provide a different HANDLE that can be waited on for notification that some of the data is ready (every M (M <= N) data records).
The UI should display the latest data at EITHER the interval or completion notifications.
Further, all of the data is captured in a BlockingCollection so the captured data can be written to files asynchronously.
For an initial feasibility effort I have 3 BackgroundWorker instances for these.
The intent was learning how the interfacing with the device works, so no design!
This is coding by accretion == throw away!
The data collection worker calls a method in a class that wraps the DLL. The wrapper method calls the above DLL methods and gets the 2 HANDLE s. They are associated with instances of AutoResetEvent which are waited on with WaitHandle.WaitAny() . The wrapper method loops until completion, passing each data record to a delegate that was provided.
The delegate enqueues the data record in the BlockingCollection and, conditionally, updates a pointer to the next data to display (using Interlocked.Exchange() ) and Set() s a ManualResetEvent to indicate that there is something to display.
The live display worker is just a simple loop that Reset() s the ManualResetEvent (set above), WaitOne() on it, and again using Interlocked.Exchange() , gets the pointer to the data to display and displays it.
The file save worker is a foreach over the BlockingCollection.GetConsumingEnumerable() , uses the ReportProgress() to have a progress bar updated and writes each data record to its file.
This will be redesigned for the production use.
This all seems way too complicated.
BackgroundWorker doesn't seem like the correct strategy.
It seems that using System.Threading.Tasks.Task ought to be a cleaner solution.
(I haven't needed to use System.Threading.Tasks.Task on any project before, so no real experience... I have read the blog entries by Stephen Cleary.)
Any suggestions on restructuring away from "quick-n-dirty" to "clean and maintainable"?
Or pointers to how to think with System.Threading.Tasks.Task ?
Thanks.
A positive attitude may not solve every problem, but it will annoy enough people to be worth the effort.
|
|
|
|
|
Not sure how much this will help, but you can convert a WaitHandle to a Task with an extension method[^]:
public static class WaitHandleExtensions
{
private static void WaitHandleCallback(object state, bool timedOut)
{
var taskCompletionSource = (TaskCompletionSource<bool>)state;
if (timedOut)
{
taskCompletionSource.TrySetCanceled();
}
else
{
taskCompletionSource.TrySetResult(true);
}
}
public static Task WaitOneAsync(this WaitHandle waitHandle)
{
if (waitHandle == null) throw new ArgumentNullException("waitHandle");
var taskCompletionSource = new TaskCompletionSource<bool>();
var registeredWaitHandle = ThreadPool.RegisterWaitForSingleObject(waitHandle,
WaitHandleCallback, taskCompletionSource, Timeout.Infinite, true);
var result = taskCompletionSource.Task;
result.ContinueWith(_ => registeredWaitHandle.Unregister(null), TaskContinuationOptions.ExecuteSynchronously);
return result;
}
}
"These people looked deep within my soul and assigned me a number based on the order in which I joined."
- Homer
|
|
|
|
|
I like BackgroundWorker. I’ve created a “generic worker” (class) into which I can inject callbacks (work; progress; completion) that makes kicking them off easy.
Anyway, in your case, I would use a worker to poll the “data collection device”. I would use 2 ConcurrentQueues: when the “collection worker” has some record(s), it would push them onto the queues (one queue for a “display worker” and one for a “file worker”) and check if the “display” and “file” workers are running; if not, the “collection” worker would start the other worker(s) (the “slave” workers should be started from the “progress reporting event” of the “collection” worker if they are to update the UI; assuming the “collection” worker was started from the UI thread).
The “display” and “file” workers would pop records off their respective queues and do their thing until their respective queues were exhausted; exit; and get reincarnated when the “collection worker” retrieved more data.
|
|
|
|
|
I am looking for someone with a lot of experience with Windows Remote Desktop Connection to answer a basic question or two...
I have a WireShark capture (only one side) which shows 880 MBytes sent from the client running the Remote Desktop Connection, to the host; but I have no WireShark capture of the packet volume coming from the host to the client IP address. The capture is for a period spanning 32 hours. I am being asked to and determine the amount of data that might have been sent from the host to the client... I know this is a real out there question; which is why I'm looking for someone with real Remote Desktop Connection experience.
I assume that of the volume of traffic from the client to the host is 880MBytes over 32 hours; is there any way at all of guessing how much might have been sent from the host to the client?
Please be kind, this is important and I am presenting all of the information I have.
Thank you!
|
|
|
|
|
Please do not cross post.
There are only 10 types of people in the world, those who understand binary and those who don't.
|
|
|
|
|
Sadly, due to the optimisations and features in place in RDC, there's no way to know how much data will be sent from the host to the client. For instance, remote desktop is pretty clever at determining the dirty area of a screen that needs updating. This means that the "bitmap" that is transmitted back from the host can vary in size.
|
|
|
|
|
I see a lot of jobs for 'architects', but this role doesn't fit in with my beliefs. A lot of modern practices eg. Scrum encourage self organizing teams rather than having a leader. I believe teams can work better without an architect.
It seems that an 'architect' or 'lead' would be the next step in my career, but I don't think this is the right title for what I want to do. I think all/most developers should do some architecture design and I think a 'god' role would be too much for one person.
What do people think? What should an architect do?
|
|
|
|
|
Member 4487083 wrote: What should an architect do?
Use design patterns (if you believe the Gang of Four)!
|
|
|
|
|
to make project like building etc.
|
|
|
|
|
Member 4487083 wrote: What should an architect do? Whatever he or she is told; most likely design a system, which the programmers then turn into code. Much the same as a biuilding architect.
|
|
|
|
|
Richard MacCutchan wrote: design a system, which the programmers then turn into code
What are senior developers for then? Their knowledge would be wasted if they're just doing what they are told. It's the developers that will be using the architecture so I think it makes sense for all developers to have some input.
|
|
|
|
|
Well it all depends on the company and the management. There are no hard and fast rules.
|
|
|
|
|
Member 4487083 wrote: I think a 'god' role would be too much for one person. What is considered an 'architect' may vary from company to company, but it does not seem to be a god role. And yes, as a seasoned developer I had to build quite some applications without the help of an architect.
Ever seen anyone work on a whiteboard, throwing patterns around like they are lego-bricks, explaining to a group of developers the implications of each approach? Half an hour further, the blocks on the whiteboard are work-items, we got to work.
Bastard Programmer from Hell
If you can't read my code, try converting it here[^]
|
|
|
|
|
Eddy Vluggen wrote: Ever seen anyone work on a whiteboard, throwing patterns around like they are lego-bricks, explaining to a group of developers the implications of each approach? Half an hour further, the blocks on the whiteboard are work-items, we got to work.
No, I haven't seen it. I've never seen an architect capable of that, although I know a few developers who would be. An architect is ultimately just another developer with a different title. In my current team, I think there are a number of good developers who would have good input on what kind of design/patterns to use. On their own, I don't think any single developer on my team would come up with the best solution. Some of the developers on my team are far better than any architect I have seen.
|
|
|
|
|
Member 4487083 wrote: I've never seen an architect capable of that Then why does he hold the title?
Member 4487083 wrote: although I know a few developers who would be. The architects at our company are developers. How could one talk about software-architecture if one has no idea how it is built? Being a damned good developer is a prerequisite.
Member 4487083 wrote: I think there are a number of good developers who would have good input on what
kind of design/patterns to use If you have four and they disagree, things get interesting. Put the architects you meet in a room with that kind of devs and shout that the flame-wars have begun.
Member 4487083 wrote: Some of the developers on my team are far better than any architect I have seen That may be, but it sounds like you want to generalize your experience to every architect.
Not all dogs bite.
Bastard Programmer from Hell
If you can't read my code, try converting it here[^]
|
|
|
|
|
As has been pointed out Architect is a different animal depending on your perspective. An architect in a major corporate may be the guy who puts together the core design for a system and never codes (almost certainly did code at some time). In a smaller corporate he may be what you consider a Senior Developer,
I call myself a developer architect because I refuse to let go of the coding aspect and am not interested in just putting together solutions for someone else to code.
Never underestimate the power of human stupidity
RAH
|
|
|
|
|
If you think of a software architect in terms of a building architect then you're on the right road.
An architect designs the overall system, including interfaces to internal / external systems, the flow of data, the key systems / users etc. They employ top down design and map out the key processes.
If you think of the person who designs the overall system topology in an enterprise SOA system, then that's the architect.
An architect is NOT the lead developer, they are NOT the project manager and they are NOT the scrum-master.
|
|
|
|
|
Hi,
I would like some suggestion on archietecture design.
Here are my requirements
1) I have clients spreaded over multiple locations
2) Their are groups of clients connected to a common server
3) Each server will gather gb of data everyday
4) There is a main server which is connected to every other local server
5) This server will have all the data which the local server will have. local servers will send data to main server.
6) I will be doing analytics on the main server as well as local servers
My main questions are
1) Since this is big data, which database should I consider sql or nosql
2) Where can hadoop fit here?
3) Is there are framework which helps me in sending data from local to global servers
|
|
|
|
|
I am exploring SPA/Angular and all the crap that is required by modern day web development. A colleague, with more experience in this area, is suggesting the data service and the SPA code should reside in the one project. Whereas I want to split it out to a WCF serving up Json formatted data in a separate project.
My justification is that the data will also be consumed by mobile platforms and a separation is valid. The projects tend not to be huge, 20-40 views and generally have a shed load of SP Processing with the results consumed by SSRS and mobile dashboards.
Any recommendation or reading links would be appreciated.
Never underestimate the power of human stupidity
RAH
|
|
|
|
|
I am interested in becoming an application architect.
Are there any specific masters degrees that I should pursue?
Does anyone have any suggested reading material, or PluralSight courses I should watch?
I am a senior .net developer with 6 years experience. I also worked in Identity Access Management for 3 years, and am interested in taking this to the next level!
Thanks!
|
|
|
|
|
I found that the best way to learn architectural skills was to get involved in the design and architecture of applications where I work. For example, my company is replacing its legacy COBOL system with a .NET system. I have been heavily involved in the architecture and have advocated an SOA approach using WCF services. I have put together some prototypes to determine if the architecture is a good fit for the application.
Architecture takes years to learn and become expert at, and you need to be comfortable working on large, enterprise systems. The more exposure to have to these sorts of systems, then the greater will be your knowledge.
|
|
|
|
|
Joe Hoppe wrote: I am a senior .net developer with 6 years experience I'd recommend first hitting 10 years experience.
You'd have to be able to explain the N-tier architecture and it's drawbacks and benefits, how it compares to CLSA, how IIS works, the difference between MVC and MVVM. Then you'd also need to be able to explain when to optimize, or how scalable a given solution is.
Bastard Programmer from Hell
If you can't read my code, try converting it here[^]
|
|
|
|
|
Joe Hoppe wrote: application architect
With limited experience you need to specialize in an industry. Learn about the industry and how problems in that industry are solved with software.
You can look for process control books such as Agile and CMM (there is at least one other) both because you probably need some familiarity with process control but also because those tend to relate architectural problems as examples. Rather difficult to find such examples anywhere else.
You might also try reading the following regularly.
http://highscalability.com/[^]
Joe Hoppe wrote: I am a senior .net developer with 6 years experience
I would suggest you learn databases. Certainly SQL. Start with either MS SQL, Oracle or MySQL and then experiment with the others. After that then look at one of the No-SQL databases. Pretty pointless to start with one of those given that they are all different. And better to have some understanding of SQL first before attempting to understand why someone might choose to not use it in the first place.
|
|
|
|