Tag Info

Hot answers tagged

8

First I don't like using IDisposable on actual collection. It muddles the actual meaning of Disposable. I would do it like this: public class CollectionUpdateContext<T>: IDisposable // can also be inner class of custom collection { public CollectionUpdateContext(ObservableCollection<T> inner) { inner.BeginUpdate(); } ...


6

Having a separate business tier needs justification as it involves lots more work and costs more in performance (see: MS-Business Layer). According to one definition of Web Services, a Web Service is not generally required unless you are communicating between different physical tiers. Accordingly, a DLL may fit best for what you describe. It is common to use ...


5

If you want to separate the java script creation from your widgets you could also use the visitor pattern: public interface IWidgetVisitor { public void Visit(PieWidget widget); public void Visit(BarWidget widget); public void Visit(TextWidget widget); ... } public abstract class Widget { public abstract void Accept(IWidgetVisitor ...


4

If your entire stack is .net there is not much value to creating web services. Just reference the DLLs in the .net components that need them, it will be faster as there is no serialization or extra network hop involved. However, for cross platform purposes, web services are the way to go. Then you can have a .net client (ASP MVC app), java client, native ...


2

There are definitely solutions out there which attempt to model flow charts in a generic way. Things like windows workflow foundation, SSIS, routing in message queues etc. But in my experience, unless the requirement comes from a technical source. ie IP routing, fail over dns etc where a technical spec for the form of the logic exists. Its best to make ...


1

ConfigurationManager is used to access the hierarchy of '.config' (machine, app and user) available to .NET applications. Modifying some values in some of these files may require some form of service restart, pool recycle or even a machine restart to get picked up. Assuming you've already got code in place that can set the values you want, it sounds like ...


1

Code should not be environment aware, that's why we have configs. Also, you usually do not want to ship your code with development secrets (DB connection string, etc.). Or sometimes it is not desirable to give developers access to the production secrets. Although it's a typical task in programming, to have separate configurations for different environments, ...


1

When asking "why," it is important to ask two sub-questions. What does this gain us, and what does this lose us? What does this gain us? Nothing, actually. I would guess you want to cut down on copy paste. That's an admirable goal, but the idiomatic C# way to write this is actually: var drbObj = (DerivedClass)obj; What does this lose us? ...



Only top voted, non community-wiki answers of a minimum length are eligible