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... 6 1147
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
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.
"ucasesoftw are" 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...
with string() or arraylist ? the collection ?
"ucasesoftw are" <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/>
>> each contact information object supports setting a role
what is exactly a role ? (some properties) ?
"ucasesoftw are" <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/> This thread has been closed and replies have been disabled. Please start a new discussion. Similar topics |
by: Akeel Ahmed |
last post by:
Hi
I feel real silly asking this, I have been posed with a simple design question which goes as follows (I am from a procedural background and not oop which may help explain my stupidity)
I have a class called Person and a class called Developer. Developer Inherits from Person. When I call the GetDeveloper method in the devloper should this return the Developer specific information only or should this also bring back the Person...
|
by: Tony Johansson |
last post by:
Hello Experts!!
Here we use multiple inheritance from two classes.We have a class named
Person at the very top
and below this class we have a Student class and an Employee class at the
same level.
There is a class TeachingAssistent that use multiple inheritance from both
Student and Employee.
There is a method named getName is class Person.
|
by: Steve Jorgensen |
last post by:
In a recent thread, RKC (correctly, I believe), took issue with my use of
multiple parameters in a Property Let procedure to pass dimensional
arguments on the basis that, although it works, it's not obvious how the
code works if you don't know the intricacies of the Property Let/Get
syntax. Likewise, I dislike (and code to minimize the use of) the VB/VBA
syntax of returning a value by referring to the function name as if it were
a...
|
by: John Salerno |
last post by:
Hi all. I have a question about interfaces now. According to the book
I'm reading, when you implement an interface, the class or structure
has to declare all the methods that the interface includes.
My question is, if you must declare each method (as opposed to simply
'using' those methods like an #included file), then why not just
declare the methods on your own as if you created them yourself? What
advantage does using an interface...
|
by: Ken H |
last post by:
Hi I have a question about architecting solutions..
I have a part of a project which requires me to track person details (name, addresses, etc...
Should I be creating Person objects, Address objects etc as Business layer classes and then have an data access layer which actually save / updates / delete to and from the DB..
If so, and bearing in mind the 'easiest' way to pass data between the layers would be with a dataset - should my BL...
| |
by: Sam Kuehn |
last post by:
What is the correct way to "widen" the interface of an
object? Let me explain (this is not a real example but
should illustrate my point). Say you have a person
object with some properties. And you also have a
customer object that inherits from the person object and
adds some properties. I know that you cannot directly
cast from a person to a customer. But, I am in a
situation where I need to do exactly that. I could go
and copy...
|
by: Eric Cathell |
last post by:
I am using dOOdads as my persistence layer.
I have a business object Person that sits in a Project called DOMAIN
I have 2 dOOdads in a project called BLL.
one is _Person and is declared MustInherit
the other is Person and is my concrete class.
My main goal of BLL.Person is to protect custom methods and properties
against regeneration.
|
by: Hypnotik |
last post by:
Hello everyone. I'm working on multiple inheritance program. I have a pretty specific problem that I'm not sure how to overcome. I'm going to try to explain this as simple as possible. There is a person class which has some info. A student class, which inherits the person info, and has some additional info. A worker class which has it's own info, and inherits the person info. A student_worker class which inherits from all of the above classes....
|
by: =?Utf-8?B?VGVycnk=?= |
last post by:
I have made up a contrived example show the problem I am having. I have some
ReadOnly interfaces:
Public Interface IROPerson
ReadOnly Property FirstName() As String
ReadOnly Property LastName() As String
ReadOnly Property Friends() As IROPersons
End Interface
Public Interface IROPersons
Function Count() As Integer
|
by: =?Utf-8?B?V2ViQnVpbGRlcjQ1MQ==?= |
last post by:
I have a custom business object of type Person.
i created a page with check boxes that will post to a second page that is
strongly typed with the first page and i have a function that retreives all
the checked boxes from the first page. The ID value of each checkbox is the
name of a property in the business object (Name, Address, Phone, ...). I can
get all the ids no problem here.
Question is there a way to convert or evaluate a string...
|
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, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look !
Part I. Meaning of...
| |
by: Hystou |
last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it.
First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
|
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...
|
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,...
|
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();...
|
by: adsilva |
last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
|
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
| |
by: muto222 |
last post by:
How can i add a mobile payment intergratation into php mysql website.
|
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...
| |