php - Data Gateway Pattern and Foreign Keys -


how 2 concepts work ?

i have scenario

  • city table
  • country table
  • city.country_id fk country.id

    objective

  • fetch cities , display country name also

    my problem

  • fetch method cities table
  • if need country name have search or inner join doing make queries when not necessary (display city info example)

    question

  • what right way apply data gateway pattern in case.

  • you should use join if need h associated country name. add method fetchwithcountry.


    Comments

    Popular posts from this blog

    jQuery clickable div with working mailto link inside -

    java - Getting corefrences with Standard corenlp package -

    WPF: binding viewmodel property of type DateTime to Calendar inside ItemsControl -