@Greg, Greg Stevens escreveu: > Regarding 2 - What more common approach where you thinking of? Having > a separate DAO and Gateway? Do you personally separate what goes in > what purely by if it returns or deals with more than 1 record? Perhaps > having the Gateway return objects and talk to the DAO for all the > queries is the way to go? >
At first let me talk about what comes on my mind when I see the terms DAO and DAOConnector. DAO is Data Access Object (who handle the accesses (SQL) to the data). It seems to me you propose to create another "guy" to do it, the DAOConnector. And use the DAO as a DAOService. My thoughts: If you really want to do it - create an abstraction layer between the Service and DAO - I suggest you name it as DAOService and DAO or DAOManager and DAO. /"Do you personally separate what goes in what purely by if it returns or deals with more than 1 record?" / Well, I have the same doubt as yours: Should I either separate or not? But it is a issue supported by the "big ones". Martin Fowler refers to it as "Row Data Gateway" and "Table Data Gateway" - It's what I meant as /"a more common (wide used) approach"/ - an architecture knew by others programmers/architects . I'd like to use Transfer ORM with decorators. A suggestion about the other issue "DAO should return either objects or queries?": It can returns either, like transfer does. Just call getById() or getByIdArray() PS: It's just my thoughts, just a personal opinion. Another issue: About table columns names. I started using a name standard that is working very well for me: Every table column I prefix with 3 characters from it's table name. For instance when I want the products listed by category: categories ========== ctg_id ctg_name products ======== prd_id prd_name prd_ctg_id So when I need to JOIN the tables I *never* need to refer to its table name: SELECT prd_name AS productName, ctg_name AS categoryName FROM products INNER JOIN categories ON (prd_ctg_id = ctg_id) ORDER BY ctg_name, prd_name In transfer.xml I use aliases in column names so I still use tobjProduct.getId() and tobjProduct.getName(). Ronan --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "CFCDev" group. To post to this group, send email to [email protected] To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cfcdev?hl=en -~----------~----~----~----~------~----~------~--~---
