Professional Web Applications Themes

Advanced OOP: Best OO design for rendering multiple page types to multiple devices - Dreamweaver AppDev

Hoping to get some ideas from more experienced hands regarding the best way to use object-oriented design to assist my development of a content management system destined for multiple devices. Imagine this class structure: clsContentData [interface to complex database.] clsPages [abstraction of pages, not sure whether I need this or not] clsClientDiscover clsRender [this class brings up the crux of my question] Imagine also that you're working with a language that supports a full OO featureset. You want to design a class structure so that "pages" can be built for all existing devices and can also be built for future ...

  1. #1

    Default Advanced OOP: Best OO design for rendering multiple page types to multiple devices

    Hoping to get some ideas from more experienced hands regarding the best way
    to use object-oriented design to assist my development of a content
    management system destined for multiple devices. Imagine this class
    structure:

    clsContentData [interface to complex database.]
    clsPages [abstraction of pages, not sure whether I need this
    or not]
    clsClientDiscover
    clsRender [this class brings up the crux of my question]

    Imagine also that you're working with a language that supports a full OO
    featureset. You want to design a class structure so that "pages" can be
    built for all existing devices and can also be built for future
    presentational technologies.

    I'm wondering what the good OO design is here. My insight is limited by the
    fact that I've only recently started working with languages that support
    full OOP.

    An amateur tack is to make a Jack-of-All-Trades "render" class with a
    bazillion one-shot methods:

    objRender.RenderMyUweekArticlePageForHtml
    objRender.RenderMyNewsReleaseWithThe2004DesignForB lackberry
    objRender.RenderMyNewsReleaseWithThe2004DesignForT ext

    .... etc. This approach s.

    Another possibility is to shift the complexity to clsPages, which would hold
    declarative XML descriptions/ page templates, and then have a bunch of
    methods on clsRender for rendering those pieces using different
    presentational technologies:

    objRender.RenderNavbar
    objRender.RenderBody

    Ideally use of the class involves two abstractions:

    + Hiding the specific page/content type in question. So we can call
    ".RenderNavbar" instead of ".RenderNewsreleaseNavbar" (a specific
    implementation of navbar)

    + Hiding the device type. We can call ".RenderNewsRelease" rather than
    ".RenderNewsReleaseForBlackberry", confident that the render method will
    interact appropriately with clsClientDiscover to determine what the clients
    capabilities are and send the right page.

    What's the right OO structure here? I'll be using ASP.NET with C# or VB.NET.
    Yet another possiblity is that I might take advantage of some intrinsic part
    of ASP.NET (e.g. user controls, server controls) to manage some aspects of
    the complexity, but I don't know offhand if that's the cleanest or best
    approach.

    General question. Any insights gratefully accepted.

    Thanks.
    Ken Fine


    Ken Fine Guest

  2. #2

    Default Re: Advanced OOP: Best OO design for rendering multiple page types to multiple devices

    "Ken Fine" <kenfineu.washington.edu> wrote in message
    news:d6oqqm$nk6$1forums.macromedia.com...
    > Imagine also that you're working with a language that supports a full OO
    > featureset. You want to design a class structure so that "pages" can be
    > built for all existing devices and can also be built for future
    > presentational technologies.
    >
    > I'm wondering what the good OO design is here. My insight is limited by
    the
    > fact that I've only recently started working with languages that support
    > full OOP.
    It's hard to suggest without knowing the whole design in more details.
    Anyway, I would go with a Factory:
    [url]http://en.wikipedia.org/wiki/Abstract_factory_pattern[/url]

    This way you can leverage polymorphism. You can have a method like
    RenderFactory.getInstance(). You pass an argument to that method that
    specify the target device, sort of: RenderFactory.getInstance("browser") or
    RenderFactory.getInstance("pda"). And you get a different rendering class
    depending on the kind of device. Of course, each different rendering class
    must obey to the same interface (you may also make them all extend an
    abstract rendering class).

    The advantage of such a design is that you can add more rendering classes at
    any stage, as soon as they support the same interface (same set of
    methods/signature), the rendering classes becomes pluggable.

    Hope it will help


    ----------------------------
    Massimo Foti
    Tools for ColdFusion and Dreamweaver developers:
    [url]http://www.massimocorner.com[/url]
    ----------------------------






    Massimo Foti Guest

  3. #3

    Default Re: Advanced OOP: Best OO design for rendering multiple page types to multiple devices

    I suggest you go to [url]http://msdn.microsoft.com/[/url] where there are all kinds of
    architectural doents, best practices and so on. You should also learn
    Microsoft's .NET naming conventions as 'clsWhatever' reads poorly and is
    really no longer neccessary when using professional tools such as Visual
    Studio. There are several architects who have published complete working
    naming and style doents. I would also focus on using ASP.NET 2.0 Beta 2,
    forget about VB , use C# as it and JavaScript are nearly identical, you
    learn two languages for the price of one. More actually, as Java itself is
    the same as C# differing only in its framework and perhaps more importantly,
    all new languages coming from research.microsoft.com are being created using
    C#.


    <%= Clinton Gallagher
    METROmilwaukee (sm) "A Regional Information Service"
    NET csgallagher AT metromilwaukee.com
    URL [url]http://metromilwaukee.com/[/url]
    URL [url]http://clintongallagher.metromilwaukee.com/[/url]



    "Ken Fine" <kenfineu.washington.edu> wrote in message
    news:d6oqqm$nk6$1forums.macromedia.com...
    > Hoping to get some ideas from more experienced hands regarding the best
    > way to use object-oriented design to assist my development of a content
    > management system destined for multiple devices. Imagine this class
    > structure:
    >
    > clsContentData [interface to complex database.]
    > clsPages [abstraction of pages, not sure whether I need this
    > or not]
    > clsClientDiscover
    > clsRender [this class brings up the crux of my question]
    >
    > Imagine also that you're working with a language that supports a full OO
    > featureset. You want to design a class structure so that "pages" can be
    > built for all existing devices and can also be built for future
    > presentational technologies.
    >
    > I'm wondering what the good OO design is here. My insight is limited by
    > the fact that I've only recently started working with languages that
    > support full OOP.
    >
    > An amateur tack is to make a Jack-of-All-Trades "render" class with a
    > bazillion one-shot methods:
    >
    > objRender.RenderMyUweekArticlePageForHtml
    > objRender.RenderMyNewsReleaseWithThe2004DesignForB lackberry
    > objRender.RenderMyNewsReleaseWithThe2004DesignForT ext
    >
    > ... etc. This approach s.
    >
    > Another possibility is to shift the complexity to clsPages, which would
    > hold declarative XML descriptions/ page templates, and then have a bunch
    > of methods on clsRender for rendering those pieces using different
    > presentational technologies:
    >
    > objRender.RenderNavbar
    > objRender.RenderBody
    >
    > Ideally use of the class involves two abstractions:
    >
    > + Hiding the specific page/content type in question. So we can call
    > ".RenderNavbar" instead of ".RenderNewsreleaseNavbar" (a specific
    > implementation of navbar)
    >
    > + Hiding the device type. We can call ".RenderNewsRelease" rather than
    > ".RenderNewsReleaseForBlackberry", confident that the render method will
    > interact appropriately with clsClientDiscover to determine what the
    > clients capabilities are and send the right page.
    >
    > What's the right OO structure here? I'll be using ASP.NET with C# or
    > VB.NET. Yet another possiblity is that I might take advantage of some
    > intrinsic part of ASP.NET (e.g. user controls, server controls) to manage
    > some aspects of the complexity, but I don't know offhand if that's the
    > cleanest or best approach.
    >
    > General question. Any insights gratefully accepted.
    >
    > Thanks.
    > Ken Fine
    >
    >

    clintonG Guest

  4. #4

    Default Re: Advanced OOP: Best OO design for rendering multiple page types to multiple devices

    Excellent advice from two people who know what they're talking about. Thank
    you very much.

    I always "deprecate" my table and class naming conventions when I post to
    USENET so my intent is clear. VS.NET USENET clients are few and far between.
    :)

    I will definitely review msdn et. al, thank you for the pointer. I've
    installed VS.NET 2005 beta 2, so ASP.NET 2.0 is my future.

    The VS.NET Class Designer is an amazing tool, as is the rest of Visual
    Studio 2005. It'll be interesting to see how it competes for the hearts and
    minds of developers who grew up on Dreamweaver MX/ Ultradev.

    -KF


    "clintonG" <csgallagherREMOVETHISTEXTmetromilwaukee.com> wrote in message
    news:d6q8v5$gof$1forums.macromedia.com...
    >I suggest you go to [url]http://msdn.microsoft.com/[/url] where there are all kinds of
    >architectural doents, best practices and so on. You should also learn
    >Microsoft's .NET naming conventions as 'clsWhatever' reads poorly and is
    >really no longer neccessary when using professional tools such as Visual
    >Studio. There are several architects who have published complete working
    >naming and style doents. I would also focus on using ASP.NET 2.0 Beta 2,
    >forget about VB , use C# as it and JavaScript are nearly identical, you
    >learn two languages for the price of one. More actually, as Java itself is
    >the same as C# differing only in its framework and perhaps more
    >importantly, all new languages coming from research.microsoft.com are being
    >created using C#.
    >
    >
    > <%= Clinton Gallagher
    > METROmilwaukee (sm) "A Regional Information Service"
    > NET csgallagher AT metromilwaukee.com
    > URL [url]http://metromilwaukee.com/[/url]
    > URL [url]http://clintongallagher.metromilwaukee.com/[/url]
    >
    >
    >
    > "Ken Fine" <kenfineu.washington.edu> wrote in message
    > news:d6oqqm$nk6$1forums.macromedia.com...
    >> Hoping to get some ideas from more experienced hands regarding the best
    >> way to use object-oriented design to assist my development of a content
    >> management system destined for multiple devices. Imagine this class
    >> structure:
    >>
    >> clsContentData [interface to complex database.]
    >> clsPages [abstraction of pages, not sure whether I need
    >> this or not]
    >> clsClientDiscover
    >> clsRender [this class brings up the crux of my question]
    >>
    >> Imagine also that you're working with a language that supports a full OO
    >> featureset. You want to design a class structure so that "pages" can be
    >> built for all existing devices and can also be built for future
    >> presentational technologies.
    >>
    >> I'm wondering what the good OO design is here. My insight is limited by
    >> the fact that I've only recently started working with languages that
    >> support full OOP.
    >>
    >> An amateur tack is to make a Jack-of-All-Trades "render" class with a
    >> bazillion one-shot methods:
    >>
    >> objRender.RenderMyUweekArticlePageForHtml
    >> objRender.RenderMyNewsReleaseWithThe2004DesignForB lackberry
    >> objRender.RenderMyNewsReleaseWithThe2004DesignForT ext
    >>
    >> ... etc. This approach s.
    >>
    >> Another possibility is to shift the complexity to clsPages, which would
    >> hold declarative XML descriptions/ page templates, and then have a bunch
    >> of methods on clsRender for rendering those pieces using different
    >> presentational technologies:
    >>
    >> objRender.RenderNavbar
    >> objRender.RenderBody
    >>
    >> Ideally use of the class involves two abstractions:
    >>
    >> + Hiding the specific page/content type in question. So we can call
    >> ".RenderNavbar" instead of ".RenderNewsreleaseNavbar" (a specific
    >> implementation of navbar)
    >>
    >> + Hiding the device type. We can call ".RenderNewsRelease" rather than
    >> ".RenderNewsReleaseForBlackberry", confident that the render method will
    >> interact appropriately with clsClientDiscover to determine what the
    >> clients capabilities are and send the right page.
    >>
    >> What's the right OO structure here? I'll be using ASP.NET with C# or
    >> VB.NET. Yet another possiblity is that I might take advantage of some
    >> intrinsic part of ASP.NET (e.g. user controls, server controls) to manage
    >> some aspects of the complexity, but I don't know offhand if that's the
    >> cleanest or best approach.
    >>
    >> General question. Any insights gratefully accepted.
    >>
    >> Thanks.
    >> Ken Fine
    >>
    >>
    >
    >

    Ken Fine Guest

  5. #5

    Default Re: Advanced OOP: Best OO design for rendering multiple page types to multiple devices

    Well thanks for the compliment but if I could code as well as I can talk
    about it I would be much happier ;-) OOP is very challenging for those of us
    who just picked up scripting as a 'second language.'

    There's also some impressive XML tools in VS 2005 [1] that just appeared in
    Beta 2.

    <%= Clinton Gallagher

    [1] [url]http://channel9.msdn.com/ShowPost.aspx?PostID=64642#64642[/url]



    "Ken Fine" <kenfineu.washington.edu> wrote in message
    news:d6qbnn$k0n$1forums.macromedia.com...
    > Excellent advice from two people who know what they're talking about.
    > Thank you very much.
    >
    > I always "deprecate" my table and class naming conventions when I post to
    > USENET so my intent is clear. VS.NET USENET clients are few and far
    > between. :)
    >
    > I will definitely review msdn et. al, thank you for the pointer. I've
    > installed VS.NET 2005 beta 2, so ASP.NET 2.0 is my future.
    >
    > The VS.NET Class Designer is an amazing tool, as is the rest of Visual
    > Studio 2005. It'll be interesting to see how it competes for the hearts
    > and minds of developers who grew up on Dreamweaver MX/ Ultradev.
    >
    > -KF
    >
    >
    > "clintonG" <csgallagherREMOVETHISTEXTmetromilwaukee.com> wrote in message
    > news:d6q8v5$gof$1forums.macromedia.com...
    >>I suggest you go to [url]http://msdn.microsoft.com/[/url] where there are all kinds
    >>of architectural doents, best practices and so on. You should also
    >>learn Microsoft's .NET naming conventions as 'clsWhatever' reads poorly
    >>and is really no longer neccessary when using professional tools such as
    >>Visual Studio. There are several architects who have published complete
    >>working naming and style doents. I would also focus on using ASP.NET
    >>2.0 Beta 2, forget about VB , use C# as it and JavaScript are nearly
    >>identical, you learn two languages for the price of one. More actually, as
    >>Java itself is the same as C# differing only in its framework and perhaps
    >>more importantly, all new languages coming from research.microsoft.com are
    >>being created using C#.
    >>
    >>
    >> <%= Clinton Gallagher
    >> METROmilwaukee (sm) "A Regional Information Service"
    >> NET csgallagher AT metromilwaukee.com
    >> URL [url]http://metromilwaukee.com/[/url]
    >> URL [url]http://clintongallagher.metromilwaukee.com/[/url]
    >>
    >>
    >>
    >> "Ken Fine" <kenfineu.washington.edu> wrote in message
    >> news:d6oqqm$nk6$1forums.macromedia.com...
    >>> Hoping to get some ideas from more experienced hands regarding the best
    >>> way to use object-oriented design to assist my development of a content
    >>> management system destined for multiple devices. Imagine this class
    >>> structure:
    >>>
    >>> clsContentData [interface to complex database.]
    >>> clsPages [abstraction of pages, not sure whether I need
    >>> this or not]
    >>> clsClientDiscover
    >>> clsRender [this class brings up the crux of my question]
    >>>
    >>> Imagine also that you're working with a language that supports a full OO
    >>> featureset. You want to design a class structure so that "pages" can be
    >>> built for all existing devices and can also be built for future
    >>> presentational technologies.
    >>>
    >>> I'm wondering what the good OO design is here. My insight is limited by
    >>> the fact that I've only recently started working with languages that
    >>> support full OOP.
    >>>
    >>> An amateur tack is to make a Jack-of-All-Trades "render" class with a
    >>> bazillion one-shot methods:
    >>>
    >>> objRender.RenderMyUweekArticlePageForHtml
    >>> objRender.RenderMyNewsReleaseWithThe2004DesignForB lackberry
    >>> objRender.RenderMyNewsReleaseWithThe2004DesignForT ext
    >>>
    >>> ... etc. This approach s.
    >>>
    >>> Another possibility is to shift the complexity to clsPages, which would
    >>> hold declarative XML descriptions/ page templates, and then have a bunch
    >>> of methods on clsRender for rendering those pieces using different
    >>> presentational technologies:
    >>>
    >>> objRender.RenderNavbar
    >>> objRender.RenderBody
    >>>
    >>> Ideally use of the class involves two abstractions:
    >>>
    >>> + Hiding the specific page/content type in question. So we can call
    >>> ".RenderNavbar" instead of ".RenderNewsreleaseNavbar" (a specific
    >>> implementation of navbar)
    >>>
    >>> + Hiding the device type. We can call ".RenderNewsRelease" rather than
    >>> ".RenderNewsReleaseForBlackberry", confident that the render method will
    >>> interact appropriately with clsClientDiscover to determine what the
    >>> clients capabilities are and send the right page.
    >>>
    >>> What's the right OO structure here? I'll be using ASP.NET with C# or
    >>> VB.NET. Yet another possiblity is that I might take advantage of some
    >>> intrinsic part of ASP.NET (e.g. user controls, server controls) to
    >>> manage some aspects of the complexity, but I don't know offhand if
    >>> that's the cleanest or best approach.
    >>>
    >>> General question. Any insights gratefully accepted.
    >>>
    >>> Thanks.
    >>> Ken Fine
    >>>
    >>>
    >>
    >>
    >
    >

    clintonG Guest

Similar Threads

  1. mading multiple selection in advanced datagrid
    By fivan in forum Macromedia Flex General Discussion
    Replies: 4
    Last Post: May 23rd, 08:26 AM
  2. Datagrid with multiple row types
    By Greif in forum ASP.NET Data Grid Control
    Replies: 1
    Last Post: June 2nd, 09:51 AM
  3. Binding Multiple Types To DataGrid
    By Gargamel in forum ASP.NET Data Grid Control
    Replies: 0
    Last Post: May 24th, 04:38 PM
  4. Replies: 1
    Last Post: February 1st, 06:23 AM
  5. Replies: 1
    Last Post: July 29th, 11:05 PM

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
  •  

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139