c# Programming Glossary: principle
Check well-formed XML without a try/catch? http://stackoverflow.com/questions/1026247/check-well-formed-xml-without-a-try-catch relying on a try catch for both speed and on the general principle that non exceptional circumstances shouldn't raise exceptions...
Refactoring code to avoid anti-pattern http://stackoverflow.com/questions/11224170/refactoring-code-to-avoid-anti-pattern 13148 is it good code to satisfy single responsibility principle CODE public interface IBankAccount RepositoryLayer.IRepository.. 13148 is it good code to satisfy single responsibility principle Using the Single Responsibility Principle forces my containers.. questions 150760 single responsibility principle how can i avoid code fragmentation c# .net design patterns..
Multiple Aggregates / Repositories in one Transaction http://stackoverflow.com/questions/11445657/multiple-aggregates-repositories-in-one-transaction this in his 3 part article. However this is just a guiding principle and there will be exceptions where more than one aggregate will..
Design - Where should objects be registered when using Windsor http://stackoverflow.com/questions/1410719/design-where-should-objects-be-registered-when-using-windsor that composes modules into a working application. In principle you could write the code by hand this is called Poor Man's DI..
Using StringWriter for XML Serialization http://stackoverflow.com/questions/1564718/using-stringwriter-for-xml-serialization use a byte array instead. SQL Server works on a similar principle any string passed into an xml column must be encoded as UTF..
Dependency Inject (DI) “friendly” library http://stackoverflow.com/questions/2045904/dependency-inject-di-friendly-library functions will be implemented using the SOLID class design principles as much as possible. As such there will probably be classes.. to do once you understand that DI is about patterns and principles not technology. To design the API in a DI Container agnostic.. API in a DI Container agnostic way follow these general principles Program to an interface not an implementation This principle..
Compiler Ambiguous invocation error - anonymous method and method group with Func<> or Action http://stackoverflow.com/questions/2057146/compiler-ambiguous-invocation-error-anonymous-method-and-method-group-with-fun though if the conversion is ever used it is an error The principle here is that we might want to change the rules of what can go.. we find that string X is a method that works here too. The principle here is that determining method group convertibility requires.. is something we want to avoid. The question then is which principle is better 1 maintain the invariant that overload resolution..
Why .NET String is immutable? [duplicate] http://stackoverflow.com/questions/2365272/why-net-string-is-immutable examples though we can do other versions of the same principle. I once produced a memroy saving of about half a GB by comparing..
Drawing on top of controls inside a panel (C# WinForms) http://stackoverflow.com/questions/282838/drawing-on-top-of-controls-inside-a-panel-c-winforms this for your purposes of course but this shows the basic principle. You can use the same technique for creating a control of whatever..
Generic methods in .NET cannot have their return types inferred. Why? http://stackoverflow.com/questions/3203643/generic-methods-in-net-cannot-have-their-return-types-inferred-why type inference share improve this question The general principle here is that type information flows only one way from the inside..
Ignoring accented letters in string comparison http://stackoverflow.com/questions/359827/ignoring-accented-letters-in-string-comparison More details on MichKap's blog . The principle is that is it turns 'é' into 2 successive chars 'e' acute. It..
Why array implements IList? http://stackoverflow.com/questions/5968708/why-array-implements-ilist
Properties vs Methods http://stackoverflow.com/questions/601621/properties-vs-methods the example Label is a control on a ASPX page. Is there a principle that can govern the decision in this case whether to make this..
Listing all permutations of a string/integer http://stackoverflow.com/questions/756055/listing-all-permutations-of-a-string-integer like recursion of course Since you also wanted to know the principle I did my best to explain it human language. I think recursion..
WCF - Design Parameter Decision http://stackoverflow.com/questions/9553267/wcf-design-parameter-decision Service claims no ownership on that logic. What is the SOA principle pattern that explains the above behavior Use of Renewal Service.. Service like you say they could change. I follow the principle that in SOA services should have a business meaning. I would..
Unit testing and checking private variable value http://stackoverflow.com/questions/1093020/unit-testing-and-checking-private-variable-value
Refactoring code to avoid anti-pattern http://stackoverflow.com/questions/11224170/refactoring-code-to-avoid-anti-pattern the data. Is this a violation of Single Responsibility Principle How to correct it Note The repository pattern is implemented.. responsibility principle Using the Single Responsibility Principle forces my containers to have public setters http programmers.stackexchange.com.. anti pattern but a violation of the Single Responsibility Principle for sure. The last 2 responsibilities should be moved to separate..
Polymorphism: Is ORM entity a Domain Entity or Data Entity? http://stackoverflow.com/questions/11257484/polymorphism-is-orm-entity-a-domain-entity-or-data-entity or reference 3 Will it satisfy Single Responsibility Principle CODE public interface IBankAccount int BankAccountID get set..
Dependency Inject (DI) “friendly” library http://stackoverflow.com/questions/2045904/dependency-inject-di-friendly-library is just a means to achieve that end . Apply the Hollywood Principle The Hollywood Principle in DI terms says Don't call the DI Container.. that end . Apply the Hollywood Principle The Hollywood Principle in DI terms says Don't call the DI Container it'll call you..
How to avoid Dependency Injection constructor madness? http://stackoverflow.com/questions/2420193/how-to-avoid-dependency-injection-constructor-madness is that it makes violations of the Single Responsibility Principle glaringly obvious. When that happens it's time to refactor to..
Partial Classes - are they bad design? http://stackoverflow.com/questions/2477839/partial-classes-are-they-bad-design too big you should revisit the Single Responsibility Principle . If you have three or more partial fragments for the same class..
Throwing ArgumentNullException in constructor? http://stackoverflow.com/questions/3629849/throwing-argumentnullexception-in-constructor throw the exception later. Always remember the Fail Early Principle . Concept being fail now so you don't waste time debugging or..
Can you explain Liskov Substitution Principle with a good C# example? http://stackoverflow.com/questions/4428725/can-you-explain-liskov-substitution-principle-with-a-good-c-sharp-example you explain Liskov Substitution Principle with a good C# example Can you explain Liskov Substitution.. a good C# example Can you explain Liskov Substitution Principle The 'L' of SOLID with a good C# example covering all aspects..
Dependency Injection - new instance required in several of a classes methods http://stackoverflow.com/questions/4648318/dependency-injection-new-instance-required-in-several-of-a-classes-methods of the consumer. This violates the Liskov Substitution Principle . A better option is to keep MyService as it is and then create..
Why is this switch on type case considered confusing? http://stackoverflow.com/questions/6304815/why-is-this-switch-on-type-case-considered-confusing subclasses. But this would break the Liskov Substitution Principle. where if you passed in a C object the code would work but not..
Interface naming convention http://stackoverflow.com/questions/681700/interface-naming-convention IFruit will make this obvious public class Apple IFruit Principle of least surprise applies. Not all uses of hungarian notation..
Do you use 'this' in front of instance variables? http://stackoverflow.com/questions/762025/do-you-use-this-in-front-of-instance-variables big and probably not following the Single Responsibility Principle . And lets say you are. Why keep the this. around after you..
Why is The Iteration Variable in a C# foreach statement read-only? http://stackoverflow.com/questions/776430/why-is-the-iteration-variable-in-a-c-sharp-foreach-statement-read-only Assigning a value to it breaks the Single Responsibility Principle or Curly's Law if you follow Coding Horror. A variable should..
|