By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
429,435 Members | 2,033 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 429,435 IT Pros & Developers. It's quick & easy.

question about a class person

P: n/a
If u have a class person, do u add a property adress, phoneNumber in
this class or is it better to add for exemple a class home with in
adress, phoneNumber, etc...

Dec 14 '05 #1
Share this Question
Share on Google+
6 Replies


P: n/a
Usecase,

Just as you want.

You can create a collection of phonenumbers or you can set them side by
side. If it is for a database, than I will opt probably for side by side
(just because that is easier to maintenance) although I am in doubt with the
growing type of types of phonenumbers.

If it is in a class than I will sure make a collection from it with in that
a class the properties

Type of phonenumber
phonenumber

Cor
Dec 14 '05 #2

P: n/a
This depends on your applcication's uses of the class. If it is a simple
address book then probably yes. If you are coding the game "The Sims" then
probably no.

"ucasesoftware" wrote:
If u have a class person, do u add a property adress, phoneNumber in
this class or is it better to add for exemple a class home with in
adress, phoneNumber, etc...

Dec 14 '05 #3

P: n/a
with string() or arraylist ? the collection ?

Dec 14 '05 #4

P: n/a
"ucasesoftware" <uc***********@hotmail.fr> schrieb:
If u have a class person, do u add a property adress, phoneNumber in
this class or is it better to add for exemple a class home with in
adress, phoneNumber, etc...


As others have mentioned, this depends on the circumstances. Maybe it's
better to support multiple addresses per person (for example in a property
of a collection type which supports adding and removing contact details),
and each contact information object supports setting a role (home address,
work address, secondary home address, or similar).

--
M S Herfried K. Wagner
M V P <URL:http://dotnet.mvps.org/>
V B <URL:http://classicvb.org/petition/>

Dec 14 '05 #5

P: n/a
>> each contact information object supports setting a role

what is exactly a role ? (some properties) ?

Dec 14 '05 #6

P: n/a
"ucasesoftware" <uc***********@hotmail.fr> schrieb:
each contact information object supports setting a role


what is exactly a role ? (some properties) ?


Yes, a property, either of an enumeration or of another type like string or
certain classes if the range is not known at compile time.

--
M S Herfried K. Wagner
M V P <URL:http://dotnet.mvps.org/>
V B <URL:http://classicvb.org/petition/>

Dec 14 '05 #7

This discussion thread is closed

Replies have been disabled for this discussion.