DAO Design pattern

Hi,
what is the advantages of DAO Design pattern over other design patterns?
Can anybody tel me

valooCK wrote:
NANDA wrote:
Hi,
what is the advantages of DAO Design pattern over other design patterns?
Can anybody tel methe answer is none!
DAO stands for data access object, it is a non oo pattern, oo is data centric, it makes sense for data to access data. it is something created by poor procedural minds who can never understand what oo is.
you may occasionary use it as a collection of functionalities or utilities, but thou shalt never use in as a pattern in oop!There are as-yet undiscovered tribes living in the Amazon, who knew you were going to say that
@OP: Please ignore this troll, he doesn't even understand the very basics of OO, as can be demonstrated in the following thread
http://forum.java.sun.com/thread.jspa?threadID=5273397&tstart=0
Just ignore him. He only wants attention. He hasn't got the faintest idea how to write even "Hello World", let alone actually do any OO design

Similar Messages

  • Struts using DAO Design Pattern ..?Please give an example..... URGENT......

    Dear all,
    I have to develop an application in Struts by using DAO design pattern ..........
    Please give an example on Struts using DAO...................
    Thank you
    Please

    I'm glad you asked. It means Read The Flaming Manual. That'd be the struts manual by the way.

  • Struts using DAO Design Pattern Tutorail

    Can anybody give me a link for the Struts using DAO Design Pattern tutorial
    sample tutorial

    http://javaboutique.internet.com/tutorials/ApacheDAOs/
    Found by using google: strust dao pattern tutorial
    There are more good links using that search...

  • DAO design pattern & Transaction boundaries

    I am using a tool to generate a JDBC tier that applies the DAO design pattern. However, the generated code is based on "autocommit"-strategy, i.e. there is no conn.setautocommit(false)-statement in the code.
    I have added statement so that I can handle the transaction by myself. The DataAccessObject-implementation class does however close the connection before returning. I would like to execute the commit outside of the DAO-implementation.
    Anyone who have been experiencing the same problem?
    Best regards
    Lasse Bergstr�m

    I'm not sure if I fully understand your question.
    However, we usually implement such a scenario by doing autocommit false on the connection object and then passing it to the DAO. Finally do a commit on the connection in the calling class.

  • How to generate report from two tables using DAO design pattern?

    Hi,
    Iam using struts with DAO pattern for my application. According to DAO design im creating model class for each table in my database with getter,setter methods. i have no problem when im generating report from one table. but if have i have to join two tables whatis the better way for doing that? is it good practise to create a new model contains properties from both the tables?
    Please help me
    Thanks in Advance
    Rajesh

    Dear Rajesh,
    As per the pattern you are creating equivalent java objects for every database table under consideration in which each db field will become a private attribute and public getter and setter methods.
    If you have to display data from one table the above approach is sufficient enough.
    But in case your database is normalised ..lets take an example of Bank having Branch and Accounts tables. We dont need to repeat the whole information of the branch for every account in that branch. so we prefer to have a branch id in that table....this approach lot of insertion/deletion/updatation anomlies that may exists with the database...
    now lets come back to our topic....we shall create two java objects 1) Branch 2) Account.....
    When ever u just need to display simple report u can do it staright forward,,,,,now if u want to display branch information along with the account information....the two objects just created are not sufficient
    So i suggest u the following approaches
    1) Create an attribute of type Branch in the Accounts Object......
    This shall serve the purpose of displaying the Btranch information
    2) Create a collection object of type ( Vector or ArrayList) which can have objects of Account in the Branch Object,,,
    Now its upto u how shall u fill up the objects with appropriate sql queries.
    The method that i mentioned is followed by Oracle Toplink and Hibernate ....which provide Object to relation mapping layers.
    Any queries ...revert back to me...
    Mahesh

  • JPA DAO Design Pattern

    Hi all,
    I have one abstract DAO class and every sessionbean DAO will extend it.
    here is sample code.
    public abstract SuperDAO{
    @PersistenceContext (unitName = "stars21db")
    private EntityManager em;
    public getEM(){
    return em;
    Here is Session Bean DAO
    @Stateless
    @Local
    public class CapDaoSessionBeanBean extends SuperDAO implements CapDaoSessionBeanLocal {
    public CapDaoSessionBeanBean() {
    public getCustomer(){
    }

    Code is fine, but the wording isn't the right one. You are about to build a Facade. DAO were originally build as the ones who know how to interact with the database, with JPA this is handled by the EntityManager. Therefore the DAO pattern doesn't apply...
    --olaf                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                   

  • ANN: New Design Pattern (DAO)

    Hello,
    Thanks for your overwhelming response to our previous sample applications demonstrating various [url http://www.oracle.com/technology/sample_code/tech/java/j2ee/designpattern/index.html]design patterns.
    Continuing with the series, this month we have showcased the [url http://www.oracle.com/technology/sample_code/tech/java/j2ee/designpattern/dataaccesstier/index.html]Data Access Object (DAO) Design Pattern which is considered as a best practice for applications accessesing the database or the underlying persistence layer from the business tier.
    The DAO implements the access mechanism required to work with the data source. The data source could be a persistent store like an RDBMS, an external service like a B2B exchange, a repository like an LDAP database, or an XML Repository. Using the scenario of web based News Application, this sample application demonstrates the effective use of this pattern.
    [url http://www.oracle.com/technology/sample_code/tech/java/j2ee/designpattern/dataaccesstier/index.html]Download the sample application to learn more about this pattern.
    More Sample Applications are available at [url http://www.oracle.com/technology/sample_code/index.html]
    http://www.oracle.com/technology/sample_code/index.html
    Thanks,
    Rajat
    OTN Team

    Hi
    This is because you are not using the latest jdbc driver version. Either use the latest ojdbc14.jar downloadable from the location given in the readme(Oracle Database 10g (10.1.0.2.0) drivers),
    Or simply comment this part in the code.
    Also you may just replace the close method call with ods=null;
    Hope this helps
    Shrinivas

  • DAO object Design Pattern

    i have to develop a web base applecation which is database indepandent, to achive this functionlity i have to use DAO design pattern.
    can some one explane me more about this............................

    Data Access Object:
    Java BluePrints - Data Access Object
    JavaWorld: Write once, persist anywhere

  • Design Patterns Support in Jdev 10.1.3?

    Is Design Patterns Support included as part of JDev 10.1.3. I have seen this support in SAP NetWeaver Developer Studio where you have the option of converting existing classes to implement a certain J2EE/J2SE Design Pattern or create a new class(es) to implement a Design Pattern. I believe TogetherSoft has this support.
    Any chances this request is consider in the next major release of JDev 10.1.3?

    Dear Shmeltzer,
    My company just begins the migration from Oracle Form-based application to pure Java EE one. We will be using JDeveloper v10.1.3, persuaded by it fast GUI building, data-binding features. Before that, we have been trying out Eclipse & JBoss.
    We are going to use Swing & JSF for client, and JavaEE 5 for midtier. Persistence layer, will be JPA (EJB3 entity bean persistence) and Spring Framework DAO support. Spring DAO is interesting bcos it gives a consistent style of API (we want to support both JDBC & JPA) and consistent Exception hierarchy too. So our midtier will be partitioned (roughly according to Fowler's patterns) into 3 layers: Service, Domain/Biz Object, Data Access. Thus far is pretty standard.
    We are still pretty new to this ADF, and are still exploring.
    Now, my initial impression with ADF is that it seems to interfere too much with the kind of pattern we had in mind. The fact that ADF hides too much details from us programmers scares me -- it becomes restrictive and we are helpless as to what are going on inside (with those xml, dcx, etc). For e.g. talk about Service Locator pattern, and we cannot seem to figure out how/where it is implemented. Using ADF Data Control and Biz Components will make all the design patterns "disappear" -- we dont see DAO classes anymore bcos it has been automated. It looks more like 2-tier client-server pattern to me. :-)
    We are interested to use ADF data-binding features, so
    1) Is it still advisable to use Spring DAO layer?
    2) Is it possible to just use ADF in the Client / web tier, while the EJB container remains free of ADF technologies?
    Regards.

  • Design patterns in log4j

    hi
    i have a question that was asked to me
    what pattern does log4j appender(consoleappender,rollingfileappender etc) implement?
    candidates can be dao, facade etc....
    can somebody xplain what pattern does it use and how
    techy

    actually this question was given in an exam and the
    answer that the teacher gave was proxy pattern.Actually, if you think about it, only the individuals that programmed the log4j code know what design patterns they actually used.
    As an outsider, just because an application "looks" like a pattern might have been used, does not mean it was actually used to design the application.
    Futhermore, just because an application's functionality may fit in well with how one envisions the pattern's possible implementation, this too, does automatically equate or represent the fact that the pattern(s) were used.
    This is a poor question to have on an exam, especailly if the individuals taking the exam were not the ones that worked on log4j. If the exam was given to log4j programmers, then it is a reasonable question.
    To ask this question to assess knowledge/experience with log4j or object-oriented design patterns is a bad decision, in my opinion.
    Only close and detailed inspection of the log4j source code will reveal what design patterns were actually used. Again, to question someone on this is inappropriate, unless it is for the log4j development team, in my opinion.
    i m not able to understand how it applies proxy
    pattern?I understand your confusion.

  • Design Patterns

    Hi,
    I am new to these forums.
    I know that there are 4 types of J2EE Design Patterns.
    1. Fundamental
    2. Structural
    3. Creational
    4. Behavioral.
    Hope that's correct. Can anyone plz tell me what's the difference between them?
    Also, examples for them. ie; Under which category mentioned above, patterns like Singleton,ServiceLocator,Session facade, DAO,DTO etc fall?
    Thanks in advance.

    BigDaddyLoveHandles wrote:
    Kumaari wrote:
    Please give me some explanation in your words.
    Thanks in advance.In software engineering, a design pattern is a general reusable solution to a commonly occurring problem in software design. A design pattern is not a finished design that can be transformed directly into code. It is a description or template for how to solve a problem that can be used in many different situations. Object-oriented design patterns typically show relationships and interactions between classes or objects, without specifying the final application classes or objects that are involved. Algorithms are not thought of as design patterns, since they solve computational problems rather than design problems.
    Not all software patterns are design patterns. Design patterns deal specifically with problems at the level of software design. Other kinds of patterns, such as architectural patterns, describe problems and solutions that have alternative scopes.
    Better?
    Brilliant. Bravo sir, bravo

  • Database Design Pattern

    hi all,
    I am developing a J2SE application which is communicating with two DB schemas.
    Do any one suggest any good design pattern to manage these type of situation.
    I was thinking to create two DAO classess for two different DB schemas?
    I am using oracle 10g as database.
    Regards

    Keep in mind that Oracle is not a database. Oracleis a database management system (DBMS).
    RDBMS, no? Both acronyms apply; Oracle is a DBMS and a RDBMS.
    Then what is the official name for the
    database itself? There is no official name for "the" database, because Oracle is not a database. Oracle, SQL Server, etc. are software for managing relational databases. They provide users with the ability to create relational databases. They provide various transactional and security features related to relational databases. They host a query language interpreter so that users can search relational databases. They have internal systems databases for managing the databases that users create.

  • Connecting - JavaFX + Servlets(??) + design patterns

    Hello
    I'm a total noob in JEE world so I'm sorry if I'm asking for sth really basic.
    I would like to connect my JavaFX application with a simplest there is JEE-server. My guess is - Servlets (a good guess?). But before I start, here are some obstructions I need to face. The general goal of this whole project is to test few (around 5) JEE design patterns. It's because of my science project: "The use/usage of JEE design patterns in creating web applications". So what's the JavaFX for? My promotor asked for an application that would be handy for my College. So again what is going to be done :
    - connect the JFX app with JEE server
    - test the whole project with Cobertura, Checkstyle, Apache JMeter, Findbug, Cobertura, PMD/CMd and so on
    - refactor the project with 5 design patterns. I think I'll try to use: DAO, Intercepting Filter, any suggestions what more?
    - test again
    - compair test results. Make conclusion on the thesis.
    As for now I've found JFX class that could be used to communicate:
    http://java.sun.com/javafx/1.2/docs/api/javafx.io.http/javafx.io.http.HttpRequest.html and other from javafx.io.http
    I'm looking for the simplest way because I don't have a lot of time! :(((( So, is there a book, tool or a tutorial explaining how to quickly and simply do the stuff above?
    What I have installed:
    - winXP SP3 (linux and Eclipse still are crappy with JFX)
    - Netbeans 6.7.1 with JavaFX and now I've installed additionally:
         - Java Web Applications
         - Sun Java System Web Server 7.0
         - EJB and EAR
    Anything else I need?

    Why don't using ejb for remote client?
    It can be simpliest, you avoid web tier dev in the server and http on the fx side.
    Any version requieried for the JEE? With the sixth one, few annotations and just concentrate on your job, very nice.

  • Is there a design pattern for this?

    I'm looking for a solution to a design problem I have.
    For a restaurant booking system I need a number of different opening times describing when you can and cannot book. These opening times are essentially Jodatime Period objects. There's a set of opening times spanning a week and these are repeated for every week (a default set of opening times) however it's possible to override these opening times say for a specific day.
    The domain model would be something like a Restaurant class holding 2 Lists of OpeningTime objects one for defaultOpeningTimes and the other for overiddenOpeningTimes the overidden ones get used if they exist for the requested time period. However the database model would be a bit messy as I'd have 2 lists mapping to the same table (OpeningTime). Is that a good idea? Perhaps there's a design pattern for this, if someone could point me in the right direction I'd be very grateful, or perhaps this is the best solution? Thanks!

    jduprez wrote:
    But why do you put the logic in the database too (I'm no DB expert and I didn't know these concepts until I read your post, but that's what a dynamic view based on derived values looks like to me): performance (1 round-trip instead of two)?Hi jduprez. Long time no speakee.
    I guess part of it is that I spent many years as a DBA and modeller, and really appreciate what it's taught me about design. Also, databases are (or should be) designed from the ground up to provide data-directed requests optimally, and include all sorts of nice stuff like transaction handling that aid consistency, as well as speed.
    That said: I HATE SQL. Think Coliseum, with that emblazoned in 60-foot high letters around its walls, and it might come close to just how much I hate that so-called "language". I hate its form; I hate it's inconsistencies; I hate the fact that something like what OP is trying to do is NOT an easy task (and might involve the creation of a table that simply contains Dates, just in order to satisfy Boolean logic).
    However, once you work it out, a database view (at least from the database's standpoint; JDBC I'm not so sure about) is just like any other Table - and that I DO like.
    Programs are good at processing parameterized (ugh) temporal information; databases are good at persistence and high volume. Those two may meet at some point, but I reckon it's going to take another Codd (or Joda) before it does.
    - that's clearer to 90% of the dev team (my biased numbers, based on 50% of Java developers having decent knowledge of SQL and much less than that having the advanced SQL knowledge which I rank your suggestion at)Sounds to me like you'll get the solution that matches the skills you have then. Is that what you really want, if a better one is available?
    - that doesn't require investigating the if of your suggestion (JDBC support)Agreed, but only because my JDBC knowledge isn't what it could be. I'd also be surprised if it doesn't support access to a named view, since they were designed to be equivalent to Tables.
    - the Op is using DAOs, so it's possible, if profiling does show this is hampering performances, to change that with no impact on the client code that calls the DAO.There's no doubt that a database solution is much higher level than a programming one; but, as I said, it's what they were designed to do. And tinkering around with program optimization has the feel of a "hacker's solution" to me. Not that there's any particular problem with that - I do it quite often when I have no control over my source - but I also try to keep in mind what the "actual" problem is.
    Winston

  • How can I develop a web application using EJB design pattern?

    I have searched over the web and found quite a lot of tutorials on how to use the EJB design pattern.
    I know that there will be a home interface, EJB object interface and a SessionBean.
    But the tutorials often only cover a single class, this made me unable to get a complete picture of how EJB design pattern can be implemented into a whole system.
    I am now required to devleop an online shopping web application using EJB and JSP page.
    I think I will need to create a lot of classes: Member, ShoppingCart, Product...etc.
    What I want to ask is that, do I need to create a home interface, EJB object interface and a SessionBean for each of these classes?
    I really need some ideas on how to develop this system using EJB + JSP pages.
    Many thanks to you all.

    For every EJB that you want to create, you will need to code a home and remote interface and a bean class.
    You could start getting your ideas here
    http://www.theserverside.com/books/wiley/masteringEJB/
    http://www.coreservlets.com

Maybe you are looking for

  • My songs are in my iTunes library but the song titles do not show up on the songs list.

    I have an older generation iPod nano, do I need to go back to an older version of iTunes so I can see the song titles on the song list? If so, does anyone have a link to the oder verson?

  • How to control suppression order / evaluation

    Is there any way to control in which order suppression is applied? Lets say I have 2 attributes and the regular base dimension on my row. I want to zoom to zero level on all 3 dimensions with suppression on. Doing this in FR is extremely slow because

  • Windows 7: not all ICC profiles appear in print setup. [was: Photoshop CS6]

    Although they are in the correct folder in Windows 7, not all my ICC profiles appear in print setup. eg I have recently installed one for a Museo paper but it does not show in the list. I use the Canon Pro9500 Markll. Has anyone any idea to fix this?

  • HMTDB in a database - application in other DB

    Hi!! I'd like to know if it's possible to create an application using HTMLDB on a Database different from the database where the product (HTMLDB) is installed. I mean, the product has been installed in one DB and we'd like to create an application th

  • Bug? Copy/Paste single quote from MS Word

    I am not sure if this is a bug or not. Whenever I copy a text from MS Word that has single quotes in it (for example, This is just a 'test') and put it inside an af:inputText field, save the value in a Java bean then retrieve it for editing, the sing