I am reading the bridge design pattern from the GoF book, there is a variant defined which the author calls "Sharing implementors" illustrated by handle body / idiom in c++. I did some research to find its implmenetation but i am unable to see Reference counting technique to allow multiple objects with the same value to share a single representation of that value. can any body help me please to learn this?
for our project we use Windsor Castle to do IoC. This means that we also let the IoC container resolve the needed constructor arguments. But for some cases (wrappers, view models, etc.) we also need to pass some ctor arguments which are only known at runtime and from my opinion are needed to create a valid object. For this we use generic factories like:
For this to work I have IoC registered that factory as well as IMyWrapper, where the implementation of IMyWrapper only has one ctor overload with the string argument.
Problem: we also have created an integration test which instantiates all registered components to ensure that everything can be resolved. But this fails for obvious reasons with IMyWrapper, as the string argument is not registered!
I would be very happy if you could tell me what you think about it.
1. Is there a way to let certain components exclusively be instantiated by generic factories so the test could differ and it would not be possible to acquire an instance directly without using the needed string argument?
2. Am I wrong and it is generally bad practice to provide runtime parameters to constructors?
3. If not, would you limit your freedom of doing so just to make the integration test check 100% well?
My question is whether there are best practices around color-coding flow-charts and similar diagrams. Do certain colors belong to certain symbols? (such as Yellow for "decisions" while green for "data") If so, what are they? Are there resources online that you know of regarding this?
I have an Ethernet connected motion controller that I need to get information from. I'm using WPF (C# flavor) for the project. The goal is to get data from the device as fast as possible so the UI doesn't seem sluggish.
My thought was to spin off a background task that constantly polled the device for information as fast as it could run. It would fire events when certain groups of data were updated. Another class would monitor for these events and then set dependency properties that would update the UI.
I have a couple questions:
1) What is the best way of starting the background task? I want it to close when the main thread is closed and not stop the main thread from being closed.
2) Any helpful advice as to how data can be retrieved on one thread that will eventually be displayed on a different thread.
I have only toyed with multi-threaded applications up to this point. I'd rather ask and do it right than to find out later there was a better way.
This is on a closed network on the machine. It is not going over a corporate network.
The device does not fire events. It has an API that allows data to be requested and then it replies. Right now I am using a DispatchTimer to request updates at a regular interval. It is running at 25ms without any issues. I was looking at trying to free my UI from my polling routine in case the device locks up or stops responding.
If you think you can, you will.
If you think you can't, you won't.
Either way, you're right.
My thought was to spin off a background task that constantly polled the device for information as fast as it could run
This is a very bad idea resulting in a very high system and network load. You should check if the motion controller provides some kind of notification messages (sending data to an established network connection).
Using a worker thread for such network communications is the common and best way. To stop such a worker thread, it is usally listening for a terminate event (besides the communication events) that can be signaled when your application terminates.
To pass data from the worker thread to the main (GUI) thread and vice-versa you must implement some kind of inter-thread communication.
How to implement threads and inter-thread communication depends on the used language.
Currently when client is logged in to my system, the user's session is bound to some server (lets say there are 4 instances of the same server on 4 PCs) and is handled only on this server.
I'm going to put servers into cluster with distributed cache where user sessions will be stored and be accessible from each of these servers.
There is a problem, I dont know which distributed cache product to use (i need exactly .NET solution), I found something about memchached, microsoft's AppFabric, etc..
But everything is very superficial (or i'm bad googleman ), could someone advice something? what is the best in the performance? maybe there is some good comparative analysis topic, etc?
I couldn't found out which topic to post it in, because I do not know which programming language(s), do this. Thats why I posted it here because it is design and architecture for programs. So what programming languages do this, answers will be fully appreciated.
You can set your application icon under properties - application tab - resources - icon in visual studio, and this determines the icon for your application on the desktop and the task bar. You can further set a different icon for each separate window in your application, which determines the icon displayed in that window's title bar.
When I was a coder, we worked on algorithms. Today, we memorize APIs for countless libraries — those libraries have the algorithms - Eric Allman
Last Visit: 31-Dec-99 19:00 Last Update: 3-Dec-23 11:54