I have an app I am wanting to build it in as OO as possible. I have a user who can have multiple addresses. What I have done is create an address class and an addresses class. Addresses is a collection of address and it has properties like item, count, delete, ect... class address has the actuall address information so in the code I can run:
dim add as new address
dim addresses as new addresses
add.address1 = "123 address"
add.City = "city"
Addresses.Add(add)
3 questions:
1.) is this a good way to do this
2.) I have clients and employees how do I attach addresses to them. Same way instanciate client and do client.addresses.add(add) if so how do I make addresses part of client class?
3.) When a someone looks up a client is it faster to load multiple addresses and client information all at once or wait until the addresses are requested and hit the db a second time?
Thanks for any help!
dim add as new address
dim addresses as new addresses
add.address1 = "123 address"
add.City = "city"
Addresses.Add(add)
3 questions:
1.) is this a good way to do this
2.) I have clients and employees how do I attach addresses to them. Same way instanciate client and do client.addresses.add(add) if so how do I make addresses part of client class?
3.) When a someone looks up a client is it faster to load multiple addresses and client information all at once or wait until the addresses are requested and hit the db a second time?
Thanks for any help!