methodology

Lazy loading - what's the best approach?

白昼怎懂夜的黑 提交于 2019-11-29 11:50:58
问题 I have seen numerous examples of lazy loading - what's your choice? Given a model class for example: public class Person { private IList<Child> _children; public IList<Child> Children { get { if (_children == null) LoadChildren(); return _children; } } } The Person class should not know anything about how it's children are loaded .... or should it? Surely it should control when properties are populated, or not? Would you have a repository that couples a Person together with its children

In git, how can I find the revision at which a branch was created?

只愿长相守 提交于 2019-11-28 21:23:45
UPDATE: example repository, https://github.com/so-gitdemo/so-gitdemorepo In the context of the github repo. How can I easily locate rev "b0430cee"? I know I can just look, but the real example that this repository mimics has a dozen committers and multiple other branches. Not quite as easy to use inspection. How can I find the branch creation revision when the branch has been merged multiple times? I am aware of this question: How to determine when a Git branch was created? The solution does not appear to work for a branch that has been merged multiple times. We typically merge bug fixes back

Is continuous integration worth it for small projects?

醉酒当歌 提交于 2019-11-28 18:47:04
I've been pushing for continuous integration at my company since I joined 5 months ago, but having seen the type of applications we work on I'm starting to think that it might not be worth the effort of setting up each and every project for continuous integration. If you work in a development department where the average project takes 2-3 weeks and once it's deployed you seldom if ever have to worry about it, is continuous integration worth the hassle of setting it up? Probably depends on your process. If you have unit tests that cover your code, then continuous integration is worth every bit.

Business Logic in Database versus Code? [closed]

。_饼干妹妹 提交于 2019-11-28 15:34:11
As a software engineer, I have a strong bias towards writing business logic in the application layer, while typically relying on the database for little more than CRUD (Create Retrieve Update and Delete) operations. On the other hand, I have run across applications (typically older ones) where a large amount of the business logic was written in stored procedures, so there are people out there that prefer to write business logic in the database layer. For the people that have and/or enjoy written/writing business logic in a stored procedure, what were/are your reasons for using this method? I

Method for finding memory leak in large Java heap dumps

主宰稳场 提交于 2019-11-28 14:38:49
问题 I have to find a memory leak in a Java application. I have some experience with this but would like advice on a methodology/strategy for this. Any reference and advice is welcome. About our situation: Heap dumps are larger than 1 GB We have heap dumps from 5 occasions. We don't have any test case to provoke this. It only happens in the (massive) system test environment after at least a weeks usage. The system is built on a internally developed legacy framework with so many design flaws that

How do you debug php “Out of Memory” issues?

你说的曾经没有我的故事 提交于 2019-11-28 07:15:55
I've had some issues lately with PHP memory limits lately: Out of memory (allocated 22544384) (tried to allocate 232 bytes) These are quite the nuisance to debug since I'm not left with a lot of info about what caused the issue. Adding a shutdown function has helped register_shutdown_function('shutdown'); then, using error_get_last (); I can obtain information about the last error, in this case, the "Out of memory" fatal error, such as the line number, and the php file name. This is nice and all, but my php program is heavily object oriented. An error deep in the stack doesn't tell me much

Exposing Member Objects As Properties or Methods in .NET

流过昼夜 提交于 2019-11-27 19:51:35
In .NET, if a class contains a member that is a class object, should that member be exposed as a property or with a method? If all you are doing is exposing an object instance that is relevant to the state of the current object you should use a property. A method should be used when you have some logic that is doing more than accessing an in memory object and returning that value or when you are performing an action that has a broad affect on the state of the current object. You should use properties for anything that conceptually represents the object's state, so long as its retrieval isn't

Is continuous integration worth it for small projects?

送分小仙女□ 提交于 2019-11-27 11:40:08
问题 I've been pushing for continuous integration at my company since I joined 5 months ago, but having seen the type of applications we work on I'm starting to think that it might not be worth the effort of setting up each and every project for continuous integration. If you work in a development department where the average project takes 2-3 weeks and once it's deployed you seldom if ever have to worry about it, is continuous integration worth the hassle of setting it up? 回答1: Probably depends

Looking for clean WinForms MVC tutorial for C# [closed]

烈酒焚心 提交于 2019-11-27 06:16:15
How to create a rich user interface Windows application, example Photo Shop. I am looking for clean MVC tutorial for WinForms with C# somewhere. ( Not ASP.NET MVC.) Being new on the Windows Platform; most MSDN and internet tutorials basically puts everything into the Form class. Further Default events are handled inside of the form, instead of sending events to the control/model, which in it's turn changes the view's state. Or is the preferred methodology for Windows Applications something else? Derick Bailey (via Los Techies) has blogged some fantastic articles (and complete demo source code)

Why selecting by ID is not recommended in CSS? [closed]

旧时模样 提交于 2019-11-27 03:14:17
问题 In CSS Lint, they don't recommend using an id for selecting elements. I trust CSS Lint because it written by smart people who know CSS very good and in depth. But I want to know what are reasons of this? Why is selecting with an id not a good thing? 回答1: CSSLint gives a guide to why they make their recommendations: IDs shouldn't be used in selectors because these rules are too tightly coupled with the HTML and have no possibility of reuse. It's much preferred to use classes in selectors and