This discussion is archived
1 2 Previous Next 18 Replies Latest reply: Apr 23, 2013 9:35 AM by jschellSomeoneStoleMyAlias Go to original post RSS
  • 15. Re: Maintaining SQL Queries in a separate text file
    1003591 Newbie
    Currently Being Moderated
    Thanks 936517 ,

    Absolutely,

    I also prefer to write clean, compact codes and comment lines for complex codes. That is why I am not using Hibernate here because it is complex, hard to implement with MVC concept and will cause programming overheads.

    This is my first thread ever in forums and your comments are really useful and helpful.

    Thanks guys!! Thank you very much.. :-)
  • 16. Re: Maintaining SQL Queries in a separate text file
    gimbal2 Guru
    Currently Being Moderated
    1000588 wrote:
    Thanks 936517 ,

    Absolutely,

    I also prefer to write clean, compact codes and comment lines for complex codes. That is why I am not using Hibernate here because it is complex, hard to implement with MVC concept and will cause programming overheads.
    Errr, only when you use it really badly. Hibernate makes my code far simpler and cleaner.
  • 17. Re: Maintaining SQL Queries in a separate text file
    jschellSomeoneStoleMyAlias Expert
    Currently Being Moderated
    1000588 wrote:
    I am working on web based project using Spring MVC framework and I am maintaining all SQL queries in a separate text file so that I can change them any time when needed.
    That will not provide any benefit.

    In the vast number of cases a "change" is something that impacts the nature of the SQL itself. So for example you need to add a new column. But when you do that you will also need to change the code that uses the SQL also.

    So what happens in a maintenance cycle is that the programmer must first find your alternative source, modify it, then modify the code that uses it to add the new column.

    Conversely if the SQL is in the source then the maintenance cycle only requires the last step.

    Storing it in the database requires additional complexity, for example as discussed how you will load it.

    If you want to provide a disconnected layer then implement all of your database calls via stored procedures. That, potentially, allows a DBA to manage only the database side while an application developer manages the application side.
  • 18. Re: Maintaining SQL Queries in a separate text file
    jschellSomeoneStoleMyAlias Expert
    Currently Being Moderated
    1000588 wrote:
    Thanks 936517 ,

    Absolutely,

    I also prefer to write clean, compact codes and comment lines for complex codes. That is why I am not using Hibernate here because it is complex, hard to implement with MVC concept and will cause programming overheads.
    Most of what you said is unlikely to be true.

    So "clean, compact codes" is based on a subjective determination which, at best, can only be verified by formal code reviews. Those at least insure that what you think is clean/compact and what is complex is at least some other people think of it that way as well. And some people might find hibernate much more clean/compact.

    Hibernate does add complexity, since by its nature it is another layer (more than one in terms of its implementation actually) however your original suggestion also adds complexity. So certainly you can't use that either if that is a primary goal.

    Hibernate will add no significant overhead and is very unlikely to add and measurable overhead. It is much more likely that requirements/design/architecture will in fact add significant overhead. And specifically a poor data model in terms of effective database design is another possible problem area.
1 2 Previous Next

Legend

  • Correct Answers - 10 points
  • Helpful Answers - 5 points