About petshop v3.0 MS could have done a better job


I took a look at
the Petshop
v3.0
all I can say is , it’s not
something I would have recomended for customers to see and learn about best
practices in real world application.
 
1. they said they
now support oracle , that’s great but why copy the code in the Data Layer and
not use Object Oriented and make an abstraction layer to the DataBase (I even
think there is a document about how to support the DataLayer using only
Interfaces ).
2. the oracle
helper and the sqlhelper has the same code, point 1 is relevant here
too.
3. Factory pattern:
they used a so called “Factory” for the Data Access Layer but still produced a
class for each dal, I don’t call it a factory , I just can’t . if they would’ve
done it properly they wouldn’t  need to produce a class that does the same
code (even the reflection code repeats itself in each
class).
4. code reuse –
there is non in this application , at least in the Business Layer. a real world
application has to maintain the code over time, code reuse helps writing less
code , debugging less code and maintaining less
code.
5. this application
is not scalable, coupling the Business Layer with the Front End one is for small
application, when you build E-Commerce site you would like to seperate
it.
 
I know that they
are going to do performance tests against a newer version of Java petshop, but
why claim they use best practices on the .net version , that’s bad PR for
.net.  They better do all the code inline and that will surely beat
Java.
 
I’ll summit it: I
don’t like this version it doesn’t teach you too much except for defining each
layer responsibility, they didn’t go all the way as they should have. I don’t
see a big diffirence between this versoin v2.0 , well ok they cleaned it , did
some layering but that’s it. I really don’t get it
.
 


Comments (3)

  1. Jhai says:

    Can you recommend something else? I want to learn how to do it the right way, but currently these are the only things I can look at. And to think I thought it had a good design!

  2. Yosi Taguri says:

    I would reccomend looking at http://www.microsoft.com/patterns for guidance