porno porno rokettube
Results 1 to 2 of 2

Thread: inheritance, basttract classes, design patterns....

  1. #1
    Junior Member
    Join Date
    Feb 2013
    Posts
    1

    inheritance, basttract classes, design patterns....

    Hello, forst of all sorry for my bad english.
    I use grails for about 1 year and I a passionate programmer.
    I have a problem on defining the design for an application.
    I have one or more companies.
    Each of these companies have one or more business and each of these business can be a shop, an ecommerce, a vending machine, and so on.
    I'he tried to implement in this way:

    abstract class Business {
    String name
    String state
    String notes

    static mapping = {
    tablePerHierarchy false
    }
    }

    class Shop extends Business {
    String street
    String street_number
    String district
    String sector
    }

    class Ecommerce extends Business {
    String website
    }

    class VendingMachine extends Business {
    String street
    String street_number
    }


    What do you think about this solution?
    Some folks suggested me to use composite pattern instead.
    Thank you.

  2. #2
    Administrator dave's Avatar
    Join Date
    Mar 2010
    Location
    West Yorkshire, UK - Valencia Spain
    Posts
    110
    Nothing wrong there that I can see, I utilise the same pattern very often myself.
    Connect with me on twitter : @davebrown1975 http://twitter.com/davebrown1975

    Web & Mobile Development by Tucanoo Solutions Ltd

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Forum Design by Tucanoo Solutions Ltd Grails Development Specialists.