Hello all,
I have an object in business layer called
JPPage
Which has the properties:
id
title
content
parent
level
what I want to know is. I have a crumb trail on my front end which
only requires the properties id and title. So do I use a collection of
JPPage objects (even though the JPPage object has more properties that
I need for my crumb trail) or do I create a crumb trail object with
properties id and title? If I do this then in essense I have duplicate
code.
Or do I create an object, for example, called JPSimplePage with the
properties id and title and then create an object JPPage which
inherits JPSimplePage and has the additional properties of content,
parent and level?
Thanks in advance, just want to get my OO methology correct.
thanks
RussRussell,
First off, I don't see anything overly wrong with having a collection of
JPPage objects which only have a couple of their properties set. The only
real problem I see is that people might try to access other properties -
since it's fairly reasonable to expect the entire set of properties to be
properly set.
I think your inheritance idea is the way to go. This way there's no
confusion about what data is available when.
KArl
MY ASP.Net tutorials
http://www.openmymind.net/
"Russell" <russell8mccloy@.hotmail.com> wrote in message
news:15098e16.0411250431.6fcaa40d@.posting.google.com...
> Hello all,
> I have an object in business layer called
> JPPage
> Which has the properties:
> id
> title
> content
> parent
> level
> what I want to know is. I have a crumb trail on my front end which
> only requires the properties id and title. So do I use a collection of
> JPPage objects (even though the JPPage object has more properties that
> I need for my crumb trail) or do I create a crumb trail object with
> properties id and title? If I do this then in essense I have duplicate
> code.
> Or do I create an object, for example, called JPSimplePage with the
> properties id and title and then create an object JPPage which
> inherits JPSimplePage and has the additional properties of content,
> parent and level?
> Thanks in advance, just want to get my OO methology correct.
> thanks
> Russ
cheers Karl.. I thought you might say that. Im loving OO. no more
spagetti code!!
RuSs
*** Sent via Developersdex http://www.examnotes.net ***
Don't just participate in USENET...get rewarded for it!
Russell if you have duplicate code then you may need a further level in your
hierarchy
How about :
BaseObject
id
CrumbObject : BaseObject
title
JPPage : CrumObject
content
parent
level
MattC
"Russell" <russell8mccloy@.hotmail.com> wrote in message
news:15098e16.0411250431.6fcaa40d@.posting.google.com...
> Hello all,
> I have an object in business layer called
> JPPage
> Which has the properties:
> id
> title
> content
> parent
> level
> what I want to know is. I have a crumb trail on my front end which
> only requires the properties id and title. So do I use a collection of
> JPPage objects (even though the JPPage object has more properties that
> I need for my crumb trail) or do I create a crumb trail object with
> properties id and title? If I do this then in essense I have duplicate
> code.
> Or do I create an object, for example, called JPSimplePage with the
> properties id and title and then create an object JPPage which
> inherits JPSimplePage and has the additional properties of content,
> parent and level?
> Thanks in advance, just want to get my OO methology correct.
> thanks
> Russ
Thursday, March 29, 2012
object oriented question
Labels:
asp,
business,
calledjppagewhich,
crumb,
layer,
net,
object,
oriented,
propertiesidtitlecontentparentlevelwhat
Subscribe to:
Post Comments (Atom)
0 comments:
Post a Comment