• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Ron McLeod
  • Paul Clapham
  • Jeanne Boyarsky
  • Liutauras Vilda
Sheriffs:
  • Rob Spoor
  • Bear Bibeault
  • Tim Cooke
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Piet Souris
Bartenders:
  • Frits Walraven
  • Himai Minh

SQL Antipatterns: MVC and Common Pitfalls in DB application development

 
Ranch Hand
Posts: 49
Spring Redhat Clojure
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi Bill,

Though these are few open ended question, but still would like to ask.

1) How can SQL Antipatterns help in MVC architecture?

and

2) What are the common pitfalls in DB application development, using Java?

Thanks
Sunil
 
author
Posts: 32
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Sunil Tiwari wrote:1) How can SQL Antipatterns help in MVC architecture?


I do have a chapter titled Magic Beans in my book, about the MVC architecture. The MVC antipattern I see most commonly is for application development frameworks such as Ruby on Rails (and its imitators) to simplify MVC by making the Model an instance of the Active Record data access component. Martin Fowler describes Active Record (http://martinfowler.com/eaaCatalog/activeRecord.html), but he also describes several other data access patterns. Unfortunately, frameworks that try to simplify application development push the idea that all you need is Active Record. Of course most applications in the real world are more complex, and you have to encapsulate that complexity somewhere. So users of these frameworks end up putting a lot of their domain logic into their Controller classes, which leads to fat controllers, code duplication, and difficulty in unit testing.

Sunil Tiwari wrote:2) What are the common pitfalls in DB application development, using Java?


I have standard advice for Java developers:
  • 90% of the issues you will face are related to your CLASSPATH.
  • Of the remaining problems that are not due to CLASSPATH, 90% of those are related to your classloader.

  • This is kind of a glib answer, but I think it's not far from being true. In Java, the biggest hurdle that faces every developer (edit: every developer who uses JDBC, that is) is to try to understand how to load a JDBC driver and get a connection to the database. It's probably the first time a Java developer uses the reflection API (perhaps the only time).

    This isn't the most advanced or complex issue, but it's the most common one, because every developer has to learn to connect to the database first, before doing anything further. And let's face it, there's quite a steep learning curve to understanding the steps of connecting to a database.
     
    Sunil Tiwari
    Ranch Hand
    Posts: 49
    Spring Redhat Clojure
    • Mark post as helpful
    • send pies
      Number of slices to send:
      Optional 'thank-you' note:
    • Quote
    • Report post to moderator
    Thanks Bill! Looking forward to read more !
     
    blacksmith
    Posts: 979
    • Mark post as helpful
    • send pies
      Number of slices to send:
      Optional 'thank-you' note:
    • Quote
    • Report post to moderator

    Bill Karwin wrote:...unfortunately, frameworks that try to simplify application development push the idea that all you need is Active Record. Of course most applications in the real world are more complex, and you have to encapsulate that complexity somewhere. So users of these frameworks end up putting a lot of their domain logic into their Controller classes, which leads to fat controllers, code duplication, and difficulty in unit testing.



    ...this is good to hear from someone else Although these frameworks
    have their advantages the remaining 20% is quite tough sometimes...
     
    You showed up just in time for the waffles! And this tiny ad:
    Building a Better World in your Backyard by Paul Wheaton and Shawn Klassen-Koop
    https://coderanch.com/wiki/718759/books/Building-World-Backyard-Paul-Wheaton
    reply
      Bookmark Topic Watch Topic
    • New Topic