application-design

Hibernate lazy-load application design

蓝咒 提交于 2019-11-27 08:59:03
问题 I tend to use Hibernate in combination with Spring framework and it's declarative transaction demarcation capabilities (e.g., @Transactional). As we all known, hibernate tries to be as non-invasive and as transparent as possible, however this proves a bit more challenging when employing lazy-loaded relationships. I see a number of design alternatives with different levels of transparency. Make relationships not lazy-loaded (e.g., fetchType=FetchType.EAGER) This vioalites the entire idea of

Is Using .NET 4.0 Tuples in my C# Code a Poor Design Decision?

梦想的初衷 提交于 2019-11-26 17:55:25
问题 With the addition of the Tuple class in .net 4, I have been trying to decide if using them in my design is a bad choice or not. The way I see it, a Tuple can be a shortcut to writing a result class (I am sure there are other uses too). So this: public class ResultType { public string StringValue { get; set; } public int IntValue { get; set; } } public ResultType GetAClassedValue() { //..Do Some Stuff ResultType result = new ResultType { StringValue = "A String", IntValue = 2 }; return result;