Somewhat advanced OO design question

G

Guest

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 us to 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.RenderMyNewsReleaseWithThe2004DesignForBlackberry
objRender.RenderMyNewsReleaseWithThe2004DesignForText

.... 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. I'll be going to TechEd,
so if you know of sessions I should be paying particular attention to,
please let me know.

Thanks.

Ken Fine
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,755
Messages
2,569,536
Members
45,020
Latest member
GenesisGai

Latest Threads

Top