Votes for business logic enhancement

2002-09-24
2002-09-24
  • Theo Albers

    Theo Albers - 2002-09-24

    By: deyanp ( Deyan Petrov )  2002-09-24 09:41 

    OK,

    1) Which approach shall we use
    1.1) abstract business classes (ala ObjectSpaces)
    1.2) source/bytecode enhancement (ala JDO)
    1.3) optimal use of reflection (Hibernate - 10x Theo for the url hibernate.sourceforge.net)

    I vote for 1.3) - it is the least obtrusive to the domain model approach, the overhead is not big (Hibernate is the prove)

     
    • Theo Albers

      Theo Albers - 2002-09-24

      Eventhough reflection is about 13 times slower than direct acces, I vote for reflection:
      * it's simpler
      * it's clearer

      However, the "related values collection" requires special attention (like orderlines of order).
      The OPF broker should provide a special collection type for handling lazy loading. This means that the business logic should also specify some special type I guess....So, it's not:

      public class Order
      {
           private Orderlines _orderlines;

      But perhaps:
      public class Order
      {
           private VirtualCollection _orderlines;

      Else I don't know how the OPF is able to intercept the load request....

       
    • Fernando Silva

      Fernando Silva - 2002-09-24

      I vote for 1.3!

       
    • Deyan Petrov

      Deyan Petrov - 2002-09-24

      Theo,

      The collections are substituted discretely upon instantiating the type with other proxy lazyload collections. Look in the docs of Hibernate.

      Regards,
      Deyan

       
    • Theo Albers

      Theo Albers - 2002-09-24

      Well guys, I suddenly remember why some frameworks use public fields/properties when mapping. The issue is querying! When I map the private "_name" of:

      public class Person
      {
          private string _name;
          public string Name { get; set; }

      to some db column, I have a problem when the user queries something like:
         OPath(typeof(Person), "Name = 'Bill'");
      For Name I don't have a mapping to "_name", so I don't have a mapping to the db column.

      Well we have to sort this out, but we'll focus first on the mapping repository.

       

Log in to post a comment.