Learned from code review
- You initialize an object in variable declaration like:
public static readonly ContactInfo = new ContactInfo(constantCompanyName);
- You can use interface to differncitate differnt presenters targetted to differnt platform, like one for web and one for WPF:
public class SearchEnginePresenter : IWebPresenter
- .... is there a design pattern called Broken Rule Pattern?
- There's an argument about whether we should call a collection of Rules as "repository". Seems like repository is a "Domain Driven Design" thing.
- Domain Specific language encourages using Positive English Phrasing instead double (or qudriple) negative like !(IsNotRight(!IncorrectItem(a)).
- Instead of using HasBeenSaved(), use IsDirty or IsNew which sounds clearer.
- Seems like a lot of code use "out" to return value... doesn't look too OO..
- Readabulity Issue: Is the method "ThisIsNotTheItemsWeAreLooingFor() " a more readable method ..... a debate....
- Role of Presenter: how much workflow logic should be in presenter, or should we use Presenter as as thin a layer as possible, and call Business Layer as much as possible in presenter instead?
- use nullable type (int?) as return value is a good way to differentiate empty value return and no return. And try aviod using checking zero as indicator of no return. nullable type is here, so use it.
public static readonly ContactInfo = new ContactInfo(constantCompanyName);
- You can use interface to differncitate differnt presenters targetted to differnt platform, like one for web and one for WPF:
public class SearchEnginePresenter : IWebPresenter
- .... is there a design pattern called Broken Rule Pattern?
- There's an argument about whether we should call a collection of Rules as "repository". Seems like repository is a "Domain Driven Design" thing.
- Domain Specific language encourages using Positive English Phrasing instead double (or qudriple) negative like !(IsNotRight(!IncorrectItem(a)).
- Instead of using HasBeenSaved(), use IsDirty or IsNew which sounds clearer.
- Seems like a lot of code use "out" to return value... doesn't look too OO..
- Readabulity Issue: Is the method "ThisIsNotTheItemsWeAreLooingFor() " a more readable method ..... a debate....
- Role of Presenter: how much workflow logic should be in presenter, or should we use Presenter as as thin a layer as possible, and call Business Layer as much as possible in presenter instead?
- use nullable type (int?) as return value is a good way to differentiate empty value return and no return. And try aviod using checking zero as indicator of no return. nullable type is here, so use it.
0 Comments:
Post a Comment
<< Home