Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>One thing that's always important (to me) is how testable a class is. I see a lot of explicit object construction in your code. Your Gift BL class explicitly depends on GiftDAL, which makes it very difficult to test the Gift class. Try to reduce the coupling between classes by making an abstraction of GiftDAL (e.g. an interface) and provide that to Gift from the outside (<a href="http://en.wikipedia.org/wiki/Dependency_injection" rel="nofollow">Dependency Injection</a>).</p> <p>A great book about good software design principle is <a href="http://rads.stackoverflow.com/amzn/click/0132350882" rel="nofollow">Clean Code by Robert C. Martin</a>. He establishes the <a href="http://en.wikipedia.org/wiki/Solid_%28object-oriented_design%29" rel="nofollow">SOLID</a> principles. Check it out!</p> <p>Also, be aware that you are now including persistence within your business logic class (or domain model as it is also called). This can be done (<a href="http://en.wikipedia.org/wiki/Active_record_pattern" rel="nofollow">Active Record</a>), but often people choose for a different approach nowadays where they separate their domain model from any infrastructure. The broad idea is: the fact that the objects need somehow be stored is important, but not important for the business logic itself, so those to concerns should be separated where possible. Often an <a href="http://en.wikipedia.org/wiki/Object-relational_mapping" rel="nofollow">Object Relational Mapper</a>, for .NET <a href="http://nhforge.org/" rel="nofollow">NHibernate</a> or <a href="http://en.wikipedia.org/wiki/ADO.NET_Entity_Framework" rel="nofollow">Entity Framework</a> are two examples for OR mappers. </p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload