473,836 Members | 2,120 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

ASP.NET/OOP and adding specific logic to controls in overriden methods

I have an odd business requirement and I think that the implementation
is not correct in the terms of OOP development. Any help on the
concepts would be very appreciated!

We currently have a custom Page object which is derived from the base
Page object. We also have custom controls that derive from a base
class that performs custom drawing and inherits from our own
IOurControl interface. There is also a special caching layer in the
mix that retrieves object information from a database/application
cache based on a control id (this is a simplified explanation).

What would be ideal in the eyes of my boss would be that each of our
custom objects retrieves data from the cache on its OnInit event and
draws the content on its OnRender event so our custom page doesn't
have to iterate the custom controls and fire methods accordingly.

Although I understand his reasoning for wanting to do so, I believe
that the methods for getting data and setting content should be added
to the controls IOurControl interface and that our custom page object
should be responsible for looping its child controls and invoking
those methods as needed. His way requires the developers of new
controls to have to know ahead of time where to place specific code or
the controls won't function properly when used in context with our
Page. I also entertained using abstract methods in the control's base
class but since the implementation would be different for each
control, it seemed pointless.

Is my boss' way the best way to implement the solution as far as OOP
concepts go, is my suggestion the best way or is there a better way of
doing so?

Feb 27 '07 #1
12 1607
Howdy,

I have just one question ;-) What's the company name so i would know where
not to apply ;-)
--
Milosz

"Bob Jones" wrote:
I have an odd business requirement and I think that the implementation
is not correct in the terms of OOP development. Any help on the
concepts would be very appreciated!

We currently have a custom Page object which is derived from the base
Page object. We also have custom controls that derive from a base
class that performs custom drawing and inherits from our own
IOurControl interface. There is also a special caching layer in the
mix that retrieves object information from a database/application
cache based on a control id (this is a simplified explanation).

What would be ideal in the eyes of my boss would be that each of our
custom objects retrieves data from the cache on its OnInit event and
draws the content on its OnRender event so our custom page doesn't
have to iterate the custom controls and fire methods accordingly.

Although I understand his reasoning for wanting to do so, I believe
that the methods for getting data and setting content should be added
to the controls IOurControl interface and that our custom page object
should be responsible for looping its child controls and invoking
those methods as needed. His way requires the developers of new
controls to have to know ahead of time where to place specific code or
the controls won't function properly when used in context with our
Page. I also entertained using abstract methods in the control's base
class but since the implementation would be different for each
control, it seemed pointless.

Is my boss' way the best way to implement the solution as far as OOP
concepts go, is my suggestion the best way or is there a better way of
doing so?

Feb 27 '07 #2
On Feb 27, 10:08 am, Milosz Skalecki [MCAD]
<mily...@DONTLI KESPAMwp.plwrot e:
Howdy,

I have just one question ;-) What's the company name so i would know where
not to apply ;-)
--
Milosz

"Bob Jones" wrote:
I have an odd business requirement and I think that the implementation
is not correct in the terms of OOP development. Any help on the
concepts would be very appreciated!
We currently have a custom Page object which is derived from the base
Page object. We also have custom controls that derive from a base
class that performs custom drawing and inherits from our own
IOurControl interface. There is also a special caching layer in the
mix that retrieves object information from a database/application
cache based on a control id (this is a simplified explanation).
What would be ideal in the eyes of my boss would be that each of our
custom objects retrieves data from the cache on its OnInit event and
draws the content on its OnRender event so our custom page doesn't
have to iterate the custom controls and fire methods accordingly.
Although I understand his reasoning for wanting to do so, I believe
that the methods for getting data and setting content should be added
to the controls IOurControl interface and that our custom page object
should be responsible for looping its child controls and invoking
those methods as needed. His way requires the developers of new
controls to have to know ahead of time where to place specific code or
the controls won't function properly when used in context with our
Page. I also entertained using abstract methods in the control's base
class but since the implementation would be different for each
control, it seemed pointless.
Is my boss' way the best way to implement the solution as far as OOP
concepts go, is my suggestion the best way or is there a better way of
doing so?- Hide quoted text -

- Show quoted text -
Milosz,

Trust me, I can appreciate the humor, but can you or anyone else
provide a meaningful answer to the question? I would like to have an
outside opinion on the matter.

=o)

Feb 27 '07 #3
On Feb 27, 9:31 am, "Bob Jones" <goodold...@gma il.comwrote:
I have an odd business requirement and I think that the implementation
is not correct in the terms of OOP development. Any help on the
concepts would be very appreciated!

We currently have a custom Page object which is derived from the base
Page object. We also have custom controls that derive from a base
class that performs custom drawing and inherits from our own
IOurControl interface. There is also a special caching layer in the
mix that retrieves object information from a database/application
cache based on a control id (this is a simplified explanation).

What would be ideal in the eyes of my boss would be that each of our
custom objects retrieves data from the cache on its OnInit event and
draws the content on its OnRender event so our custom page doesn't
have to iterate the custom controls and fire methods accordingly.

Although I understand his reasoning for wanting to do so, I believe
that the methods for getting data and setting content should be added
to the controls IOurControl interface and that our custom page object
should be responsible for looping its child controls and invoking
those methods as needed. His way requires the developers of new
controls to have to know ahead of time where to place specific code or
the controls won't function properly when used in context with our
Page. I also entertained using abstract methods in the control's base
class but since the implementation would be different for each
control, it seemed pointless.

Is my boss' way the best way to implement the solution as far as OOP
concepts go, is my suggestion the best way or is there a better way of
doing so?
Just cross-posting this message

Feb 27 '07 #4
I have an odd business requirement and I think that the implementation
is not correct in the terms of OOP development. Any help on the
concepts would be very appreciated!
We currently have a custom Page object which is derived from the base
Page object. We also have custom controls that derive from a base
class that performs custom drawing and inherits from our own
IOurControl interface. There is also a special caching layer in the
mix that retrieves object information from a database/application
cache based on a control id (this is a simplified explanation).
What would be ideal in the eyes of my boss would be that each of our
custom objects retrieves data from the cache on its OnInit event and
draws the content on its OnRender event so our custom page doesn't
have to iterate the custom controls and fire methods accordingly.
Although I understand his reasoning for wanting to do so, I believe
that the methods for getting data and setting content should be added
to the controls IOurControl interface and that our custom page object
should be responsible for looping its child controls and invoking
those methods as needed. His way requires the developers of new
controls to have to know ahead of time where to place specific code or
the controls won't function properly when used in context with our
Page. I also entertained using abstract methods in the control's base
class but since the implementation would be different for each
control, it seemed pointless.
Is my boss' way the best way to implement the solution as far as OOP
concepts go, is my suggestion the best way or is there a better way of
doing so?
Feb 27 '07 #5
I have an odd business requirement and I think that the implementation
is not correct in the terms of OOP development. Any help on the
concepts would be very appreciated!

We currently have a custom Page object which is derived from the base
Page object. We also have custom controls that derive from a base
class that performs custom drawing and inherits from our own
IOurControl interface. There is also a special caching layer in the
mix that retrieves object information from a database/application
cache based on a control id (this is a simplified explanation).

What would be ideal in the eyes of my boss would be that each of our
custom objects retrieves data from the cache on its OnInit event and
draws the content on its OnRender event so our custom page doesn't
have to iterate the custom controls and fire methods accordingly.

Although I understand his reasoning for wanting to do so, I believe
that the methods for getting data and setting content should be added
to the controls IOurControl interface and that our custom page object
should be responsible for looping its child controls and invoking
those methods as needed. His way requires the developers of new
controls to have to know ahead of time where to place specific code or
the controls won't function properly when used in context with our
Page. I also entertained using abstract methods in the control's base
class but since the implementation would be different for each
control, it seemed pointless.

Is my boss' way the best way to implement the solution as far as OOP
concepts go, is my suggestion the best way or is there a better way of
doing so?

Feb 27 '07 #6
Hi Bob,

Sorry to say that, but I’m unable to help you, (to be honest) my point of
view at web architecture is completely different. I’m a big fan of making
things easier and clear. I always try to design controls as a separate
presentation blocks that have nothing to do with database or data retrieval
(meaning I’m usually focused on reusability and performance). This is because
in large scale web applications (I usually work on) performance is very
important, data itself is quite big and dynamic (so it’s not possible to
cache everything), so it’s vital to collect required information as quick and
efficient as it gets, usually in one or maximum few database roundtrips, plus
usage of cache, viewstate, application and session states. Therefore when I
see controls that make calls to database I’m really horrified. Let me explain
why:
• Try to reuse control elsewhere (meaning with different database schema you
simply can’t or it’s a big task
• Performance, every time you embed such control, it is responsible for
retrieving the data, meaning using these controls in conjunction with
datalist, gridview is expensive. In addition, it’s not possible to reuse
information you have already have (you usually end up with copying bits to
another data table and binding it to a list)
• There are many dependencies, therefore every single developer involved
must know everything or almost everything, it’s difficult to split tasks
between teams (have in mind all of source control issues related to that), or
delegate simple tasks to less experienced team members or junior developers
• You mentioned about database logic based on control id - it’s just
ridiculous (or I’m really missing something)

From my experience I know it’s easy to develop reusable controls that are
independent on data, you can alsywas go the same path as MST went with field
mapping (i.e. DataTextField, DataValueField, DataValueFormat String, mapping
interface or any similar generic approach.). I know everyone of us developers
has to be open on suggestions and make sure things have been done before
deadline ;) I‘m really serious about the company name :-) Could you pass it
to me so next time I look for a job I would not apply *accidentally* ;-)

Regards

Milosz

"Bob Jones" wrote:
On Feb 27, 10:08 am, Milosz Skalecki [MCAD]
<mily...@DONTLI KESPAMwp.plwrot e:
Howdy,

I have just one question ;-) What's the company name so i would know where
not to apply ;-)
--
Milosz

"Bob Jones" wrote:
I have an odd business requirement and I think that the implementation
is not correct in the terms of OOP development. Any help on the
concepts would be very appreciated!
We currently have a custom Page object which is derived from the base
Page object. We also have custom controls that derive from a base
class that performs custom drawing and inherits from our own
IOurControl interface. There is also a special caching layer in the
mix that retrieves object information from a database/application
cache based on a control id (this is a simplified explanation).
What would be ideal in the eyes of my boss would be that each of our
custom objects retrieves data from the cache on its OnInit event and
draws the content on its OnRender event so our custom page doesn't
have to iterate the custom controls and fire methods accordingly.
Although I understand his reasoning for wanting to do so, I believe
that the methods for getting data and setting content should be added
to the controls IOurControl interface and that our custom page object
should be responsible for looping its child controls and invoking
those methods as needed. His way requires the developers of new
controls to have to know ahead of time where to place specific code or
the controls won't function properly when used in context with our
Page. I also entertained using abstract methods in the control's base
class but since the implementation would be different for each
control, it seemed pointless.
Is my boss' way the best way to implement the solution as far as OOP
concepts go, is my suggestion the best way or is there a better way of
doing so?- Hide quoted text -
- Show quoted text -

Milosz,

Trust me, I can appreciate the humor, but can you or anyone else
provide a meaningful answer to the question? I would like to have an
outside opinion on the matter.

=o)

Feb 27 '07 #7
On Feb 27, 11:52 am, Milosz Skalecki [MCAD]
<mily...@DONTLI KESPAMwp.plwrot e:
Hi Bob,

Sorry to say that, but I'm unable to help you, (to be honest) my point of
view at web architecture is completely different. I'm a big fan of making
things easier and clear. I always try to design controls as a separate
presentation blocks that have nothing to do with database or data retrieval
(meaning I'm usually focused on reusability and performance). This is because
in large scale web applications (I usually work on) performance is very
important, data itself is quite big and dynamic (so it's not possible to
cache everything), so it's vital to collect required information as quickand
efficient as it gets, usually in one or maximum few database roundtrips, plus
usage of cache, viewstate, application and session states. Therefore whenI
see controls that make calls to database I'm really horrified. Let me explain
why:
Try to reuse control elsewhere (meaning with different database schema you
simply can't or it's a big task
Performance, every time you embed such control, it is responsiblefor
retrieving the data, meaning using these controls in conjunction with
datalist, gridview is expensive. In addition, it's not possible to reuse
information you have already have (you usually end up with copying bits to
another data table and binding it to a list)
There are many dependencies, therefore every single developer involved
must know everything or almost everything, it's difficult to split tasks
between teams (have in mind all of source control issues related to that), or
delegate simple tasks to less experienced team members or junior developers
You mentioned about database logic based on control id - it's just
ridiculous (or I'm really missing something)

From my experience I know it's easy to develop reusable controls that are
independent on data, you can alsywas go the same path as MST went with field
mapping (i.e. DataTextField, DataValueField, DataValueFormat String, mapping
interface or any similar generic approach.). I know everyone of us developers
has to be open on suggestions and make sure things have been done before
deadline ;) I'm really serious about the company name :-) Could you pass it
to me so next time I look for a job I would not apply *accidentally* ;-)

Regards

Milosz

"Bob Jones" wrote:
On Feb 27, 10:08 am, Milosz Skalecki [MCAD]
<mily...@DONTLI KESPAMwp.plwrot e:
Howdy,
I have just one question ;-) What's the company name so i would know where
not to apply ;-)
--
Milosz
"Bob Jones" wrote:
I have an odd business requirement and I think that the implementation
is not correct in the terms of OOP development. Any help on the
concepts would be very appreciated!
We currently have a custom Page object which is derived from the base
Page object. We also have custom controls that derive from a base
class that performs custom drawing and inherits from our own
IOurControl interface. There is also a special caching layer in the
mix that retrieves object information from a database/application
cache based on a control id (this is a simplified explanation).
What would be ideal in the eyes of my boss would be that each of our
custom objects retrieves data from the cache on its OnInit event and
draws the content on its OnRender event so our custom page doesn't
have to iterate the custom controls and fire methods accordingly.
Although I understand his reasoning for wanting to do so, I believe
that the methods for getting data and setting content should be added
to the controls IOurControl interface and that our custom page object
should be responsible for looping its child controls and invoking
those methods as needed. His way requires the developers of new
controls to have to know ahead of time where to place specific codeor
the controls won't function properly when used in context with our
Page. I also entertained using abstract methods in the control's base
class but since the implementation would be different for each
control, it seemed pointless.
Is my boss' way the best way to implement the solution as far as OOP
concepts go, is my suggestion the best way or is there a better wayof
doing so?- Hide quoted text -
- Show quoted text -
Milosz,
Trust me, I can appreciate the humor, but can you or anyone else
provide a meaningful answer to the question? I would like to have an
outside opinion on the matter.
=o)- Hide quoted text -

- Show quoted text -
Milosz,

I agree with everything you said and if I were to design this
application from scratch I would def. take a different approach.

The controls, however, are NOT databound but get information from a
caching sytem. But that was just information I gave out to give a
bigger picture. My question is basically the last part of my post.
Would it be better to make our custom Page object loop it's child
controls and call the appropiate methods (MyInit, MyRender) while
passing in needed data or would it be better to force the developers
to hard code methods in each control's OnInit and OnRender functions?

Obviously my take is the former so I can code against an Interface and
not rely on having junior level developers or contracts have to have a
manual next to them in order to write custom controls.

I cannot tell you the company name in the forums but if you would
like, send me an e-mail I can reply to and I will send you the name
(if you respond backto this post w/ your opinion). =o)

Regards,
Bob

Feb 27 '07 #8
I know i know there is nothing you can do :-)

Another resolution would be to register every control that implements
IOurControl interface in base page as it can access containing page instance
via Page property (inside controls' oninit virtual method).

-- begin base page class --
.....
private System.Collecti ons.Generic.Lis t<IOurControlou rControls = new
System.Collecti ons.Generic.Lis t<IOurControl>( );

public System.Collecti ons.Generic.Lis t<IOurControlOu rControls
{
get
{
return this.ourControl s;
}
}

protected override void OnPreRenderComp lete(EventArgs e)
{
base.OnPreRende rComplete(e);

foreach (IOurControl control in ourControls)
{
control.OurInte rfaceMethod();
}
}
-- end base page class --
-- control that implement IOurInterface --

protected override OnInit(object sender, EventArgs e)
{
base.OnInit(sen der, e);

if (this.Page != null)
{
BasePageClassNa me basePage = (BasePageClassN ame) this.Page;
basePage.OurCon trols.Add((IOur Interface) this);
}
}
--
Milosz
"Bob Jones" wrote:
On Feb 27, 11:52 am, Milosz Skalecki [MCAD]
<mily...@DONTLI KESPAMwp.plwrot e:
Hi Bob,

Sorry to say that, but I'm unable to help you, (to be honest) my point of
view at web architecture is completely different. I'm a big fan of making
things easier and clear. I always try to design controls as a separate
presentation blocks that have nothing to do with database or data retrieval
(meaning I'm usually focused on reusability and performance). This is because
in large scale web applications (I usually work on) performance is very
important, data itself is quite big and dynamic (so it's not possible to
cache everything), so it's vital to collect required information as quick and
efficient as it gets, usually in one or maximum few database roundtrips, plus
usage of cache, viewstate, application and session states. Therefore when I
see controls that make calls to database I'm really horrified. Let me explain
why:
· Try to reuse control elsewhere (meaning with different database schema you
simply can't or it's a big task
· Performance, every time you embed such control, it is responsible for
retrieving the data, meaning using these controls in conjunction with
datalist, gridview is expensive. In addition, it's not possible to reuse
information you have already have (you usually end up with copying bits to
another data table and binding it to a list)
· There are many dependencies, therefore every single developer involved
must know everything or almost everything, it's difficult to split tasks
between teams (have in mind all of source control issues related to that), or
delegate simple tasks to less experienced team members or junior developers
· You mentioned about database logic based on control id - it's just
ridiculous (or I'm really missing something)

From my experience I know it's easy to develop reusable controls that are
independent on data, you can alsywas go the same path as MST went with field
mapping (i.e. DataTextField, DataValueField, DataValueFormat String, mapping
interface or any similar generic approach.). I know everyone of us developers
has to be open on suggestions and make sure things have been done before
deadline ;) I'm really serious about the company name :-) Could you pass it
to me so next time I look for a job I would not apply *accidentally* ;-)

Regards

Milosz

"Bob Jones" wrote:
On Feb 27, 10:08 am, Milosz Skalecki [MCAD]
<mily...@DONTLI KESPAMwp.plwrot e:
Howdy,
I have just one question ;-) What's the company name so i would know where
not to apply ;-)
--
Milosz
"Bob Jones" wrote:
I have an odd business requirement and I think that the implementation
is not correct in the terms of OOP development. Any help on the
concepts would be very appreciated!
We currently have a custom Page object which is derived from the base
Page object. We also have custom controls that derive from a base
class that performs custom drawing and inherits from our own
IOurControl interface. There is also a special caching layer in the
mix that retrieves object information from a database/application
cache based on a control id (this is a simplified explanation).
What would be ideal in the eyes of my boss would be that each of our
custom objects retrieves data from the cache on its OnInit event and
draws the content on its OnRender event so our custom page doesn't
have to iterate the custom controls and fire methods accordingly.
Although I understand his reasoning for wanting to do so, I believe
that the methods for getting data and setting content should be added
to the controls IOurControl interface and that our custom page object
should be responsible for looping its child controls and invoking
those methods as needed. His way requires the developers of new
controls to have to know ahead of time where to place specific code or
the controls won't function properly when used in context with our
Page. I also entertained using abstract methods in the control's base
class but since the implementation would be different for each
control, it seemed pointless.
Is my boss' way the best way to implement the solution as far as OOP
concepts go, is my suggestion the best way or is there a better way of
doing so?- Hide quoted text -
- Show quoted text -
Milosz,
Trust me, I can appreciate the humor, but can you or anyone else
provide a meaningful answer to the question? I would like to have an
outside opinion on the matter.
=o)- Hide quoted text -
- Show quoted text -

Milosz,

I agree with everything you said and if I were to design this
application from scratch I would def. take a different approach.

The controls, however, are NOT databound but get information from a
caching sytem. But that was just information I gave out to give a
bigger picture. My question is basically the last part of my post.
Would it be better to make our custom Page object loop it's child
controls and call the appropiate methods (MyInit, MyRender) while
passing in needed data or would it be better to force the developers
to hard code methods in each control's OnInit and OnRender functions?

Obviously my take is the former so I can code against an Interface and
not rely on having junior level developers or contracts have to have a
manual next to them in order to write custom controls.

I cannot tell you the company name in the forums but if you would
like, send me an e-mail I can reply to and I will send you the name
(if you respond backto this post w/ your opinion). =o)

Regards,
Bob

Feb 27 '07 #9
On Feb 27, 2:48 pm, Milosz Skalecki [MCAD] <mily...@DONTLI KESPAMwp.pl>
wrote:
I know i know there is nothing you can do :-)

Another resolution would be to register every control that implements
IOurControl interface in base page as it can access containing page instance
via Page property (inside controls' oninit virtual method).

-- begin base page class --
....
private System.Collecti ons.Generic.Lis t<IOurControlou rControls = new
System.Collecti ons.Generic.Lis t<IOurControl>( );

public System.Collecti ons.Generic.Lis t<IOurControlOu rControls
{
get
{
return this.ourControl s;
}

}

protected override void OnPreRenderComp lete(EventArgs e)
{
base.OnPreRende rComplete(e);

foreach (IOurControl control in ourControls)
{
control.OurInte rfaceMethod();
}}

-- end base page class --

-- control that implement IOurInterface --

protected override OnInit(object sender, EventArgs e)
{
base.OnInit(sen der, e);

if (this.Page != null)
{
BasePageClassNa me basePage = (BasePageClassN ame) this.Page;
basePage.OurCon trols.Add((IOur Interface) this);
}

}

--
Milosz

"Bob Jones" wrote:
On Feb 27, 11:52 am, Milosz Skalecki [MCAD]
<mily...@DONTLI KESPAMwp.plwrot e:
Hi Bob,
Sorry to say that, but I'm unable to help you, (to be honest) my point of
view at web architecture is completely different. I'm a big fan of making
things easier and clear. I always try to design controls as a separate
presentation blocks that have nothing to do with database or data retrieval
(meaning I'm usually focused on reusability and performance). This isbecause
in large scale web applications (I usually work on) performance is very
important, data itself is quite big and dynamic (so it's not possibleto
cache everything), so it's vital to collect required information as quick and
efficient as it gets, usually in one or maximum few database roundtrips, plus
usage of cache, viewstate, application and session states. Therefore when I
see controls that make calls to database I'm really horrified. Let meexplain
why:
Try to reuse control elsewhere (meaning with different database schema you
simply can't or it's a big task
Performance, every time you embed such control, it is responsible for
retrieving the data, meaning using these controls in conjunction with
datalist, gridview is expensive. In addition, it's not possible to reuse
information you have already have (you usually end up with copying bits to
another data table and binding it to a list)
There are many dependencies, therefore every single developerinvolv ed
must know everything or almost everything, it's difficult to split tasks
between teams (have in mind all of source control issues related to that), or
delegate simple tasks to less experienced team members or junior developers
You mentioned about database logic based on control id - it'sjust
ridiculous (or I'm really missing something)
From my experience I know it's easy to develop reusable controls thatare
independent on data, you can alsywas go the same path as MST went with field
mapping (i.e. DataTextField, DataValueField, DataValueFormat String, mapping
interface or any similar generic approach.). I know everyone of us developers
has to be open on suggestions and make sure things have been done before
deadline ;) I'm really serious about the company name :-) Could you pass it
to me so next time I look for a job I would not apply *accidentally* ;-)
Regards
Milosz
"Bob Jones" wrote:
On Feb 27, 10:08 am, Milosz Skalecki [MCAD]
<mily...@DONTLI KESPAMwp.plwrot e:
Howdy,
I have just one question ;-) What's the company name so i would know where
not to apply ;-)
--
Milosz
"Bob Jones" wrote:
I have an odd business requirement and I think that the implementation
is not correct in the terms of OOP development. Any help on the
concepts would be very appreciated!
We currently have a custom Page object which is derived from the base
Page object. We also have custom controls that derive from a base
class that performs custom drawing and inherits from our own
IOurControl interface. There is also a special caching layer inthe
mix that retrieves object information from a database/application
cache based on a control id (this is a simplified explanation).
What would be ideal in the eyes of my boss would be that each of our
custom objects retrieves data from the cache on its OnInit event and
draws the content on its OnRender event so our custom page doesn't
have to iterate the custom controls and fire methods accordingly.
Although I understand his reasoning for wanting to do so, I believe
that the methods for getting data and setting content should beadded
to the controls IOurControl interface and that our custom page object
should be responsible for looping its child controls and invoking
those methods as needed. His way requires the developers of new
controls to have to know ahead of time where to place specific code or
the controls won't function properly when used in context with our
Page. I also entertained using abstract methods in the control's base
class but since the implementation would be different for each
control, it seemed pointless.
Is my boss' way the best way to implement the solution as far as OOP
concepts go, is my suggestion the best way or is there a betterway of
doing so?- Hide quoted text -
- Show quoted text -
Milosz,
Trust me, I can appreciate the humor, but can you or anyone else
provide a meaningful answer to the question? I would like to have an
outside opinion on the matter.
=o)- Hide quoted text -
- Show quoted text -
Milosz,
I agree with everything you said and if I were to design this
application from scratch I would def. take a different approach.
The controls, however, are NOT databound but get information from a
caching sytem. But that was just information I gave out to give a
bigger picture. My question is basically the last part of my post.
Would it be better to make our custom Page object loop it's child
controls and call the appropiate methods (MyInit, MyRender) while
passing in needed data or would it be better to force the developers
to hard code methods in each control's OnInit and OnRender functions?
Obviously my take is the former so I can code against an Interface and
not rely on having junior level developers or contracts have to have a
manual next to them in order to write custom controls.
I cannot tell you the company name in the forums but if you would
like, send me an e-mail I can reply to and I will send you the name
(if you respond backto this post w/ your opinion). =o)
Regards,
Bob- Hide quoted text -

- Show quoted text -
Milosz,

Thanks for the code sample, so you do agree that having the page
control interate the child controls and calling the proper methods IS
the more proper way to go?

Bob

Feb 27 '07 #10

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

Similar topics

0
1118
by: thivi | last post by:
hi all i am developing an user control in which i am creating a set of menu objects in a panel.. i have overriden the oncontroladded and painting. whenever i add the menu object i add it to the panel. panel is maintained by using an arraylist of menu objects.. the problem is as i have overriden paint, controladded is fired 3 times for each control 1)when i add the menu control to panel in design time - in which arraylist is maintained...
3
4889
by: Jim Heavey | last post by:
Trying to figure out the technique which should be used to add rows to a datagrid. I am thinking that I would want an "Add" button on the footer, but I am not quite sure how to do that. Is that the best method? Do you have a sample of how to do this?
1
3157
by: sleigh | last post by:
Hello, I'm building a web application that will build a dynamic form based upon questions in a database. This form will have several different sections that consist of a panel containing one to many questions. To keep it simple, I'll describe the basics of what I'm trying to design. I've created a TextBox composite control that consists of a label for
5
1694
by: Jeremy Ames | last post by:
I have run into a major road block with my page development projects. I am trying to add a literal control to my asp.net page and I got an error stating that the control could not be added because of code blocks (<% %>) on the page. Most of these blocks can be handled by adding a label control to the form so it is not that big of deal, but one of the things being posted is the page title. I am not sure how I can access that from the code...
1
2035
by: seanmayhew | last post by:
I have a form page that that while editing saves the data to an xml doc before submitting to db. On each page unload it saves the xmldoc as the user can add multiple items to the company like product types etc. So for instance Im adding a fruit company while adding a fruit company I allow the user to add types of fruit they carry and display it dynamically using an <asp:table> with image
3
2349
by: Ankit Aneja | last post by:
I have a strange situation and I have no idea how to solve this. Its a Recruitment Search Page,in the Admin Page, for every button click event the Admin Person has to create a checkbox on the users page. So whenever the Admin person comes to know about the new category in the market he will be adding as different Sub-Categories for example ABAP, BDC etc..etc.. on every click event as Checkboxes. And these controls(checkboxes) should remain...
1
2054
by: srneu71 | last post by:
I have a project that requires a dynamically generated matrix table. The table is setup with 4 quadrants (N,S,E,W) with checkboxes to "link" the data in adjacent quadrants. The table has to be able to grow & shrink according to the number of items in each quadrant. I have coded the table as a user control in vb.net. My question is on how to retrieve the data out of the table on a post back. I have tried adding check boxes as straight...
1
2715
by: =?Utf-8?B?U3RldmUgUmFuZGFsbA==?= | last post by:
I have a form with a number of panel controls on it. I have overriden the paint event (of the panel controls) to provide custom painting. What I have done is to use the Paint event to paint the background colour of a number of panel controls to be a gradient colour. This works fine. Is there a better way?? The problem I have is that when I resize the parent form I get alot of flickering as the paint events are constantly fired. I have...
1
1829
by: Jordan S. | last post by:
Using .NET 3.5, I'm wondering how to get a control's specific type (e.g,. "Button" and not simply "Control") after the control is inserted into a control hierarchy - when ParseControl is used. For example, I have the following code: string str = "<table border=1><tr><td>Hello World</td></tr><tr><td><asp:Button ID=\"TestButton\" onclick=\"b_Click\" runat=\"server\" Text=\"Button\" /></td></tr><tr><td>Goodbye...
0
9812
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, well explore What is ONU, What Is Router, ONU & Routers main usage, and What is the difference between ONU and Router. Lets take a closer look ! Part I. Meaning of...
0
10824
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
10533
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
10579
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
6975
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5813
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4443
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
4003
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
3103
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.