Ask a Question related to Dreamweaver AppDev, Design and Development.
-
Ken Fine #1
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 sucks.
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
-
mading multiple selection in advanced datagrid
Hi All I'm new in Flex and AS3, so may be my problem is simple to solve but I need help anyway. I have to do the classic "Select All" button... -
Datagrid with multiple row types
I am somewhat new to using Datagrids. I would like to present a datagrid with vairous different types of styles/templates when selected/edited.... -
Binding Multiple Types To DataGrid
Hi. In my webapp, I have several types of object that derive from an abstract base class. abstract class CMSItem class Page : CMSItem class... -
Need to handle multiple types of authentication, need help
I've got an ASP.NET project that i need to support multiple types of login authentication. I've tried initially to create a login system where you... -
problem with have multiple subjects appear on the web page in multiple lines
Hello, group I have got this problem, hoping someone can help me to figure it out what is wrong. I have some fields in the database:... -
Massimo Foti #2
Re: Advanced OOP: Best OO design for rendering multiple page types to multiple devices
"Ken Fine" <kenfine@u.washington.edu> wrote in message
news:d6oqqm$nk6$1@forums.macromedia.com...the> 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 byIt's hard to suggest without knowing the whole design in more details.> fact that I've only recently started working with languages that support
> full OOP.
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
-
clintonG #3
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 documents, 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 documents. 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" <kenfine@u.washington.edu> wrote in message
news:d6oqqm$nk6$1@forums.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 sucks.
>
> 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
-
Ken Fine #4
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" <csgallagher@REMOVETHISTEXTmetromilwaukee.com> wrote in message
news:d6q8v5$gof$1@forums.macromedia.com...>I suggest you go to [url]http://msdn.microsoft.com/[/url] where there are all kinds of
>architectural documents, 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 documents. 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" <kenfine@u.washington.edu> wrote in message
> news:d6oqqm$nk6$1@forums.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 sucks.
>>
>> 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
-
clintonG #5
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" <kenfine@u.washington.edu> wrote in message
news:d6qbnn$k0n$1@forums.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" <csgallagher@REMOVETHISTEXTmetromilwaukee.com> wrote in message
> news:d6q8v5$gof$1@forums.macromedia.com...>>>I suggest you go to [url]http://msdn.microsoft.com/[/url] where there are all kinds
>>of architectural documents, 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 documents. 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" <kenfine@u.washington.edu> wrote in message
>> news:d6oqqm$nk6$1@forums.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 sucks.
>>>
>>> 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



Reply With Quote

