473,408 Members | 1,735 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,408 software developers and data experts.

Am I on the right path part 1

37
The classes are all stored in 1 library.

I created an abstract class Person (mustinherit) with 2 derived classes Employee and Student. This base class has all the properties a person would have. It also has several abstract methods for CRUD operations. Perhaps you would ask why I use abstract methods for this. My choice has to do with the database logic behind the code, I store data for persons in different tables, perhaps different sources lateron and this makes the code somewhat (not too much) different for every derived class.

My first question is quite obvious but I'll ask it anyway: I assume that all my properties must always be Public Property? Or do I just use Property? I assume that both are equal. Personally I would choose for the first because it's more obvious what the access modifier for the property is but from a esthetic perspective I'd pick the latter. Second related question: I assume that in classes that are in the actual project file that uses them, we would resort to Protected Friend Property unless there is reason not to?

Second, is using polymorphism for CRUD operations a good idea? If not, why?
Apr 19 '10 #1
1 853
Frinavale
9,735 Expert Mod 8TB
Whoa!
I'm answering your first question first:
The public scope modifier indicates that something is publicly accessible. So, you can have public and private and protected properties...you could leave the scope modifier out but usually you know what the scope of the something is and it's best to be explicit.

As for "Protected Friend Property"...these properties can be used in the class they are defined (they can be also be used within any inherited class) and they can only be accessed by code in the same project/assembly.

Maybe you should check out this MSDN article on Variable and Method Scope in Microsoft .NET.


I'm not sure what you mean when you're asking about polymorphism.
(wiki on polymorphism) You can use polymorphism if you want to/need to....
Apr 27 '10 #2

Sign in to post your reply or Sign up for a free account.

Similar topics

9
by: Ted G | last post by:
Hello, I'm new wiyh PHP and would like to ask, what is the common way to check if directory path e.g. in url and file requested are in proper format? E.g. if I would give my homepage URL in...
0
by: ADE | last post by:
Hi everyone: I was just wondering if this code makes sense to anyone. And if I am writing it correctly, the program seems to keep crashing. I was also wondering if anyone had any pointers. ...
1
by: Calvin X | last post by:
Hi All, I am getting the following error when I try to open an xml file that is in a directory just underneath the site root. 'Could not find a part of the path...
9
by: tshad | last post by:
This is from my previous post, but a different issue. I have the following Javascript routine that opens a popup page, but doesn't seem to work if called from an asp.net button. It seems to work...
2
by: Roger | last post by:
Can anyone shed some light on how to determine what the desktop path is? Obviously I know where my desktop is but I want to be able to get the path of a given users desktop path in my code at...
2
by: Fabrice | last post by:
Hello Does a solution exist to get always the right path when you use Server.Transfer in web application (version 1.1) ? I want to rewrite my URL by use Global.asax and...
5
by: Tim Daneliuk | last post by:
Ah yes, moral philosophy and python all come together... Er, that is to day: Imagine you have this situation on a *nix filesystem: Symlink A: /foo -/usr/home Symlink B: /bar -/foo/username ...
4
by: FooFighter | last post by:
I was going to make a database to store a list of my DVD's. I have a question about the table structure though. I want to have some fields for actors. I'm thinking 4 or 5 would be plenty. From...
1
by: robjens | last post by:
(second part) Last question I have is about the following construction. I made a class called LisaDataObject (Lisa is the namespace of the application). This class connects to a OleDatabase (MS...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
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,...
0
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...
0
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...
0
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...
0
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,...
0
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...

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.