• Visitors can check out the Forum FAQ by clicking this link. You have to register before you can post: click the REGISTER link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below. View our Forum Privacy Policy.
  • Want to receive the latest contracting news and advice straight to your inbox? Sign up to the ContractorUK newsletter here. Every sign up will also be entered into a draw to WIN £100 Amazon vouchers!

Object Oriented Development vs Practicality

Collapse
X
  •  
  • Filter
  • Time
  • Show
Clear All
new posts

    Object Oriented Development vs Practicality

    I am currently having a 'frank exchange of views' with a fellow lead tech on how to establish a common architecture .. I suggested the standard seperation of Component or Service based layers, Entity layer, and Data Access layer. Everyone was happy and that's been adopted.

    I like code generation... saves on reptitive tasks, and can implement patterns in a reliable way. So, I demonstrated a way of generating objects using the standard class designer in VS 2005, then, using snippets, quickly adding attributes that specified primary keys, relationships between these entities combined with a simple utility that used reflection to obtain information about exposed properties, and within 10 minutes had generated a database schema with referential integrity, a data access layer, entities that contained basic validation rules derived from the database schema, and a customisable component layer. All built on top of the Enterprise Library with associated caching, configuration, logging and exception handling... basically codesmith and .NetTiers with my own additions.

    My coworker wants to create multiple levels of inheritance, rather than my approach that would would use composition with interfaces, a Manager and Processor pattern to remove the inheritance dependcies.

    Basically, he wants to use 'pure OO' to design what I consider to be an unneccessarily complex Domain, and then use NHibernate to map persistence, and bolt on bit of CSLA.Net for a validation rules engine, he hasnt quite made it clear how he will handle other aspects such as logging and exception management.

    I do also prefer the freedom to design my objects seperate from the database structure they will reside in, but in practical terms, when most of our applications are data driven, I dont see the downside of 1) getting the database schema right and 2) using that as the basis for an object model, which can then be customised.

    Bearing in mind what is coming from MS in terms of LINQ, DLINQ and Entity Data Mapper, its seems to follow a similar pattern... design your data storage... then extrapolate your entity model from these schema... amend as required, and use DLINQ for persistance, with LINQ for querying object graphs in memory.

    Anybody any comments on this?
    Vieze Oude Man

    #2
    Which one pays the highest rate / secures contract extensions / something the PM can understand?

    Neither.

    Oh dear.
    Insanity: repeating the same actions, but expecting different results.
    threadeds website, and here's my blog.

    Comment


      #3
      Well, at the moment I am permie ... getting a years experience of .Net 2 in a finance environment .. you can guess my future plans.

      At the moment I have a set of 'things I need to know to make myself a high income'.... this is iteration 1....

      The 'arguements' with my work colleague have helped everyone to gain a clearer understanding of OO...

      I am treating this next 9 months (ive already served 3) as a period to update my skills, get training, good name on CV and plan ahead.
      Vieze Oude Man

      Comment


        #4
        Ive always found .Net to lend itself to the table module domain pattern, using
        ado.net. .Net 2 also was strongly types datasets that make this process less painful. Also composition rather than inheritance is a much better method of building object model as advocated by the Gang of Four.

        Comment


          #5
          I certainly agree with the latter point - composition with interfaces is more 'resilient' to changes rather than inheritance...

          Personally, I have not once used a production application that made use of datasets.. ADO.Net has been used to load data into entity instances in the data layer, using IDataReader, and not much more...

          It seems MS is heading in a direction that makes DataSets redundant - they were designed to be in-memory databases with relations, constraints etc, but now, LINQ / DLINQ / EDM allows that at the Entity / Component layer with classes.
          Vieze Oude Man

          Comment


            #6
            I'm all for convenience, but LINQ takes it too far.

            I use the Factory pattern and work purely with interfaces. Mainly because I have to hide the implementation from the UI developers because they are usually pants. It's also quite efficient as it's easy to shift some of the collection-oriented functions off to the data tier when creating collections or individual objects (which is precisely what the data tier excels at!!!)

            My only rule is really that ONE object composition (i.e. a product and a related category) must be represented by a view within the database.

            My framework is loosely based on CLSA.Net with a application-specific object factory and interfaces instead of abstracts basing the objects.

            Datasets will be the death of anyone - they are not scalable, they are inefficient and not domain-specific. LINQ is going to use collections underneath so you're still working with IComparers. Not so efficient!

            Working on something with my own framework now that is scaling to 20,000 concurrent connections with one dual 3.2 xeon SQL 2005 box up it's arse and 3x dual xeon 3.2's up front running web services.

            After that, I'm going to start writing stuff in Objective C for Macs because it's more fun.
            Last edited by TheMonkey; 20 August 2006, 18:54.
            Serving religion with the contempt it deserves...

            Comment


              #7
              LINQ is great - it offers compile time type checks, plus intellisense to make programming quicker - they'd better put it into .NET 3.0! IComparers are pretty good, unless you deal with literally tens of millions of records they are just fine.

              IMO interfaces are better than inheritance - much easier to ensure that underlieing changes in interface will have to be reflected in all classes that implement them as otherwise they won't compile.

              Comment


                #8
                Originally posted by AtW
                LINQ is great - it offers compile time type checks, plus intellisense to make programming quicker - they'd better put it into .NET 3.0! IComparers are pretty good, unless you deal with literally tens of millions of records they are just fine.
                I don't use intellisense as I code with my eyes shut (I'm serious!).

                IMO interfaces are better than inheritance - much easier to ensure that underlieing changes in interface will have to be reflected in all classes that implement them as otherwise they won't compile.
                Agree. Interfaces are the design reference.
                Serving religion with the contempt it deserves...

                Comment


                  #9
                  Interfaces have also higher performance than classes with inheritance - I think the difference in cost of calls can be 10 times or so, a lot if you want high performance.

                  Originally posted by TheMonkey
                  I don't use intellisense as I code with my eyes shut (I'm serious!).
                  You have it switched off? Personally I love that when I type few chars it picks up local or global varibale, function etc - make things faster.

                  Comment


                    #10
                    He uses notepad and the command line because hes hard.

                    Comment

                    Working...
                    X