?
Solved

C# newbie question

Posted on 2009-05-19
5
Medium Priority
?
180 Views
Last Modified: 2012-05-07
Hi.  My question is that if I have an Data Access Layer that writes to a DB, then a Rules layer that inherits the DAL, then a presentation layer that inherits the Rules Layer, how can I keep the methods in the DAL hidden from the presentation layer??
0
Comment
Question by:suicehockey44
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 3
  • 2
5 Comments
 
LVL 11

Expert Comment

by:saragani
ID: 24422714
0
 

Author Comment

by:suicehockey44
ID: 24422752
I see. But doesn't the Sealed class eliminated the possibility of any inheritance??? I want the Rules layer to inherit the DAL.  BUT, I do not want the other class, which inherits the Rules Layer to have access to the methods in the DAL...perhaps I am not following sealed closely enough.
0
 
LVL 11

Accepted Solution

by:
saragani earned 1500 total points
ID: 24422769
Oops sorry. I didn't read your question right... You want to prevent the inheritance of functions (not classes).. My bad.

It cannot be done... Any public method is being inherited by the child class.


The only way I can thing of is that the child class will implement an interface and then then you work with the presenter, you will always work with it using an interface object.
0
 

Author Comment

by:suicehockey44
ID: 24422801
Ok sorry I should've been more clear. Thank you and I will try using an interface.
0
 
LVL 11

Expert Comment

by:saragani
ID: 24422838
I've looked for a short example on the Internet for you:
http://stackoverflow.com/questions/106383/c-can-publicly-inherited-methods-be-hidden-e-g-made-private-to-derived-class


And you've been clear enough...  it's just me ending 11 hours of work in front of the computer and visual studio.
(Lucky me, this day is over :-) )
0

Featured Post

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Introduction Hi all and welcome to my first article on Experts Exchange. A while ago, someone asked me if i could do some tutorials on object oriented programming. I decided to do them on C#. Now you may ask me, why's that? Well, one of the re…
This article aims to explain the working of CircularLogArchiver. This tool was designed to solve the buildup of log file in cases where systems do not support circular logging or where circular logging is not enabled
Michael from AdRem Software explains how to view the most utilized and worst performing nodes in your network, by accessing the Top Charts view in NetCrunch network monitor (https://www.adremsoft.com/). Top Charts is a view in which you can set seve…
How to fix incompatible JVM issue while installing Eclipse While installing Eclipse in windows, got one error like above and unable to proceed with the installation. This video describes how to successfully install Eclipse. How to solve incompa…

771 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question