473,835 Members | 1,853 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Somewhat advanced OO design question

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]
clsClientDiscov er
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.Rende rMyUweekArticle PageForHtml
objRender.Rende rMyNewsReleaseW ithThe2004Desig nForBlackberry
objRender.Rende rMyNewsReleaseW ithThe2004Desig nForText

.... 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.Rende rNavbar
objRender.Rende rBody

Ideally use of the class involves two abstractions:

+ Hiding the specific page/content type in question. So we can call
".RenderNav bar" instead of ".RenderNewsrel easeNavbar" (a specific
implementation of navbar)

+ Hiding the device type. We can call ".RenderNewsRel ease" rather than
".RenderNewsRel easeForBlackber ry", confident that the render method will
interact appropriately with clsClientDiscov er 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
Nov 19 '05 #1
1 1404
Short answer -- look into "Strategy pattern"

http://www.dofactory.com/Patterns/PatternStrategy.aspx

--
Manohar Kamath
Editor, .netBooks
www.dotnetbooks.com
<ke*****@u.wash ington.edu> wrote in message
news:%2******** ********@TK2MSF TNGP09.phx.gbl. ..
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]
clsClientDiscov er
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.Rende rMyUweekArticle PageForHtml
objRender.Rende rMyNewsReleaseW ithThe2004Desig nForBlackberry
objRender.Rende rMyNewsReleaseW ithThe2004Desig nForText

... 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.Rende rNavbar
objRender.Rende rBody

Ideally use of the class involves two abstractions:

+ Hiding the specific page/content type in question. So we can call
".RenderNav bar" instead of ".RenderNewsrel easeNavbar" (a specific
implementation of navbar)

+ Hiding the device type. We can call ".RenderNewsRel ease" rather than
".RenderNewsRel easeForBlackber ry", confident that the render method will
interact appropriately with clsClientDiscov er 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

Nov 19 '05 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
1767
by: Jason Sirota | last post by:
I am an advanced database and vb programmer but recently my position has called for advanced archtecture descisions enterprise-wide. Although I have quite a bit of knowledge on designing relational and normalized data structures I would like to further my knowledge on large-scale distributed database design and maintenance. Can anyone suggest a decent to good book covering some of the more advanced topics of enterprise databases and...
8
2801
by: Millissa | last post by:
If someone can help me with examples of or info on how to create an advanced tables for the layout on my site, I would be very grateful! Thanks, M
7
1260
by: abhishekjha10 | last post by:
Can I get some help on the following question " what do u mean by advanced architecture of c++ ?" This question was asked in an interview.
4
5142
by: Nhmiller | last post by:
This is directly from Access' Help: "About designing a query When you open a query in Design view, or open a form, report, or datasheet and show the Advanced Filter/Sort window (Advanced Filter/Sort window: A window in which you can create a filter from scratch. You enter criteria expressions in the filter design grid to restrict the records in the open form or datasheet to a subset of records that meet the criteria.), you see the design...
4
2100
by: st_ev_fe | last post by:
Hi people, I've been doing C for about 7 years now. But I'm new to C++. I've decided that C++'s operator overloading could be very handy. I'm writing something much like auto_ptr, except for my own set of classes. Basically, it's a class that is supposed to be allocated automatically on the stack, and possesess one member which is a pointer to an object. Unlike auto_ptr, my object will actually call a lock or unlock function
2
2828
by: Mark Collard | last post by:
The ToolBar control allows you to add toolbar buttons. When you add a button, the button is not only displayed in the toolbar, but also added as a separator control in the form/usercontrol your toolbar exists in. I'm writing my own usercontrol which contains various different controls (e.g. Panel, Button). I would like these controls to be listed in the drop down just above the Properties grid, when a new instance of the usercontrol is...
1
1440
by: mbatestblrock | last post by:
I think I have a rather advanced question that I was hoping to find some good help with. I am still pretty new to VBA and I know that doesn't help my situation here. But here is what I am trying to accomplish. I have a relatively simple database. The main points are which I have a Form with a sub form in it. This form is a customer form and the main part of the form has their name address and phone number. The sub form has sales...
1
2125
by: Swathika | last post by:
Hi, Sometimes, you never get chance to learn 'Advanced Design Concepts and Real-time Scenarios' from institutes or through book-learning. But, in my blog, I have gathered some of the amazing Design concepts and practical scenarios in J2EE. Design Concepts: http://strutsjavainterviewquestions.blogspot.com/2008/07/design-level-concepts-in-j2ee.html
0
1210
by: ablesteve | last post by:
Looking for full DVD video tutoring series on C++. Somewhat basic to advanced windows and even some Web work. Please send url to my E-mail steve1va@yahoo.com All is greatly appreciated and will be able to contribute all that is learned. Thanks!!
0
10815
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10524
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
10562
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
10236
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
9348
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
7768
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5639
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
5805
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
2
3997
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.