design-decisions

Design decisions: Why and when to make an interface private?

心不动则不痛 提交于 2019-12-03 09:04:45
问题 Are private interfaces ever used in design decisions ? If so, what are the reasons and when do you know the need for a private interface? 回答1: A top-level interface cannot be private. It can only have public or package access. From the Java Language Specification, section 9.1.1: "Interface Modifiers": The access modifiers protected and private pertain only to member interfaces whose declarations are directly enclosed by a class declaration (§8.5.1). A nested interface can be private whenever

How to decide on WebForms vs ASP.NET MVC 3 for new project? [duplicate]

*爱你&永不变心* 提交于 2019-11-29 10:51:10
Possible Duplicate: MVC versus WebForms ASP.NET MVC Performance I'll be starting a new web project in the coming weeks. It's a public facing web site for a somewhat famous person. I have 2 choices: use good-old ASP.NET 4 or new ASP.NET MVC 3 with Razor. I do not plan to do any kind of unit testing. It's rather simple website mainly consisting of javascript, html and css. I'll need to build an admin panel to create/delete/edit pages; add/remove pictures to portfolio gallery. And that's probably all I need from an admin panel. Nothing complicated. Disclaimer : I do not have much experience with

When should I not use the ThreadPool in .Net? [closed]

天大地大妈咪最大 提交于 2019-11-28 17:48:24
When should I not use the ThreadPool in .Net? It looks like the best option is to use a ThreadPool, in which case, why is it not the only option? What are your experiences around this? Will The only reason why I wouldn't use the ThreadPool for cheap multithreading is if I need to… interract with the method running (e.g., to kill it) run code on a STA thread (this happened to me) keep the thread alive after my application has died ( ThreadPool threads are background threads) in case I need to change the priority of the Thread. We can not change priority of threads in ThreadPool which is by

Why are System.Drawing Rectangle, Point, Size etc mutable structs and not classes?

假如想象 提交于 2019-11-28 11:57:50
Is there a reason Microsoft decided to make these structs? All three are mutable. I would find them much easier to deal with if they were either immutable, or if they were reference types. If there are reasons they must be structs, why are they mutable? Why are they Structs Value Semantics There is no essential difference between two identical instances of these values. Any Point with coordinates, [2,3] is equal to any other point with the same coordinates, much like any two int s with similar value are equal. This is in conformance with the design guideline: It logically represents a single

How to decide on WebForms vs ASP.NET MVC 3 for new project? [duplicate]

▼魔方 西西 提交于 2019-11-28 04:46:56
问题 Possible Duplicate: MVC versus WebForms ASP.NET MVC Performance I'll be starting a new web project in the coming weeks. It's a public facing web site for a somewhat famous person. I have 2 choices: use good-old ASP.NET 4 or new ASP.NET MVC 3 with Razor. I do not plan to do any kind of unit testing. It's rather simple website mainly consisting of javascript, html and css. I'll need to build an admin panel to create/delete/edit pages; add/remove pictures to portfolio gallery. And that's

.NET Tuple and Equals performance

夙愿已清 提交于 2019-11-27 13:09:18
This is something I had not noticed until today. Apparently, the .NET implementation of the much used tuple classes ( Tuple<T> , Tuple<T1, T2> etc) causes boxing penalties for value types when equality based operations are performed. Here is how the class is kind of implemented in the framework (source via ILSpy): public class Tuple<T1, T2> : IStructuralEquatable { public T1 Item1 { get; private set; } public T2 Item2 { get; private set; } public Tuple(T1 item1, T2 item2) { this.Item1 = item1; this.Item2 = item2; } public override bool Equals(object obj) { return this.Equals(obj,

When should I not use the ThreadPool in .Net? [closed]

孤街浪徒 提交于 2019-11-27 10:46:19
问题 When should I not use the ThreadPool in .Net? It looks like the best option is to use a ThreadPool, in which case, why is it not the only option? What are your experiences around this? 回答1: The only reason why I wouldn't use the ThreadPool for cheap multithreading is if I need to… interract with the method running (e.g., to kill it) run code on a STA thread (this happened to me) keep the thread alive after my application has died ( ThreadPool threads are background threads) in case I need to

.NET Tuple and Equals performance

被刻印的时光 ゝ 提交于 2019-11-26 16:13:39
问题 This is something I had not noticed until today. Apparently, the .NET implementation of the much used tuple classes ( Tuple<T> , Tuple<T1, T2> etc) causes boxing penalties for value types when equality based operations are performed. Here is how the class is kind of implemented in the framework (source via ILSpy): public class Tuple<T1, T2> : IStructuralEquatable { public T1 Item1 { get; private set; } public T2 Item2 { get; private set; } public Tuple(T1 item1, T2 item2) { this.Item1 = item1

Why was “immediate” attribute added to the EditableValueHolders?

北城余情 提交于 2019-11-26 09:57:41
问题 Initially immediate flag was only intended for ActionSource interface. But later on it was added to the EditableValueHolder interface also. What was the reason for design decision ? 回答1: It's to be used to prioritize validation on several EditableValueHolder components in the same form. Imagine a form containing input components with immediate="true" as well as input components without this attribute. The immediate inputs will be validated during apply request values phase (which is one phase