Two Laptop Bag*
The moose likes Developer Certification (SCJD/OCMJD) and the fly likes DAOFactory.getDbManager Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Certification » Developer Certification (SCJD/OCMJD)
Bookmark "DAOFactory.getDbManager" Watch "DAOFactory.getDbManager" New topic
Author

DAOFactory.getDbManager

Himai Minh
Ranch Hand

Joined: Jul 29, 2012
Posts: 721
In Roberto buddy's DataTest class, he wrote a DAOFactory class and a getDbManager method to load the database file.
Can I load the db file in my own way?
In my instruction.html, I don't see any " must " requirement that we must have a DAOFactory class.

In my instruction.html, I don't see any "must" that says submitting any test class. Does it mean I don't need to submit my own test class?
Roel De Nijs
Bartender

Joined: Jul 19, 2004
Posts: 5126
    
  12

Easy & short answers:
  • You can load the db file as you want
  • You don't have to provide/submit any test classes


  • SCJA, SCJP (1.4 | 5.0 | 6.0), SCJD
    http://www.javaroe.be/
    Roberto Perillo
    Bartender

    Joined: Dec 28, 2007
    Posts: 2258
        
        3

    You know, if I had to do everything again today, I wouldn't have a DAOFactory. The Data class wouldn't be a singleton either. I'd instantiate the Data object when the application is started, instantiate the business object, passing the Data object as a parameter in the business class' constructor, and instantiate the window, passing the business object in the window's constructor. Although the Data object wouldn't be a singleton, it would be as if it was a singleton, since it would be unique in the application.


    Cheers, Bob "John Lennon" Perillo
    SCJP, SCWCD, SCJD, SCBCD - Daileon: A Tool for Enabling Domain Annotations
     
    I agree. Here's the link: http://aspose.com/file-tools
     
    subject: DAOFactory.getDbManager
     
    Similar Threads
    in the final countdown
    DAOFactory Classes in Sequence / Component ?
    Passing objects that persist data as mock
    My design is based on an assumption: the database has only one datafile. What if it is wrong?
    Interface provided by Sun