Click here to Skip to main content
15,890,897 members
Home / Discussions / Design and Architecture
   

Design and Architecture

 
AnswerRe: Stored Procedures [modified] Pin
Eddy Vluggen7-Jul-09 8:48
professionalEddy Vluggen7-Jul-09 8:48 
GeneralRe: Stored Procedures Pin
CodingYoshi7-Jul-09 16:59
CodingYoshi7-Jul-09 16:59 
AnswerRe: Stored Procedures Pin
David Skelly9-Jul-09 2:54
David Skelly9-Jul-09 2:54 
AnswerRe: Stored Procedures Pin
Mycroft Holmes11-Jul-09 15:29
professionalMycroft Holmes11-Jul-09 15:29 
AnswerRe: Stored Procedures Pin
CodingYoshi13-Jul-09 17:05
CodingYoshi13-Jul-09 17:05 
QuestionORM tools in domain driven design? Pin
midix28-Jun-09 8:28
midix28-Jun-09 8:28 
AnswerRe: ORM tools in domain driven design? Pin
Eddy Vluggen7-Jul-09 9:15
professionalEddy Vluggen7-Jul-09 9:15 
QuestionFirst attempt at OOD: How do I extend my design? Pin
Mark McArthey18-Jun-09 3:07
Mark McArthey18-Jun-09 3:07 
Hello all!
First off, sorry that it's a bit long but I have been struggling with this for a few days.
I could use some help with object oriented design. My experience is primarily (nearly exclusively) as a procedural programmer, so I'm struggling with the next phase of the OO design process.
I'm now working on an Employee class that will populate based upon the results of an LDAP query. So far things have been going well, but the first phase of the project has each Employee populated by the results of a FindOne() query. The value used to initialize the instance has been an employee id that is guaranteed unique so it hasn't been an issue.
The user has two options to instantiate a new object. Call the constructor with the unique value, or populate the private variables and then query AD.
Employee emp = new Employee(empID);

Employee emp = new Employee();
Employee.EmpID = "12345";
Employee.ADQuery();

For the next phase I'd like to be able to use FindAll() for the LDAP query and not assume that the value passed in will result in only a single return. For example, a user might want to instantiate the object by doing the following:
Employee emp = new Employee();
Employee.FirstName = "Joe";
Employee.ADQuery();

My first thought was, "Fine, build an array" but after reviewing the design I'm not so sure.

My design ideas have been:

Simply create an array of the private instance variables that currently exist.
I don't like this idea mainly because it seems that it breaks the Employee object model that I've created. I figure that if a user requests an Employee object, it should represent a single employee.

Create a static method that will provide another way to instantiate the object. The static method would create multiple instances of the Employee object... essentially an array of objects.
The problems I have with this is I'm not sure of a few things. I have been assuming the user would first instantiate an object and populate the instance variables with the filter criteria. If I want to allow the user to have access to all the results and not break my model, don't I need to somehow return a collection of Employee objects? Then it would seem the user would need to loop through the construct to retrieve the results. I'm not sure that requiring the looping construct to be in the implementation is the best choice. I'd like to keep the user requirements to a minimum. Also, it makes sense to me that there should be a single way of instantiating the group of objects returned.

In the end, I'm not convinced I'm not going to break my model by allowing multiple things to be returned. If I just return a big group of Employee objects, is this too much overhead? How do I do this? I'm just now getting into the concepts of OOD and am struggling with "proper" design. This doesn't seem to addressed in all of my reading. I can find the ubiquitous "Person" class, but where is the "People" implementation? Is my model just flawed and I need to rethink this?

Thanks for any clarification you can provide! Smile | :)
AnswerRe: First attempt at OOD: How do I extend my design? Pin
Mark McArthey18-Jun-09 6:01
Mark McArthey18-Jun-09 6:01 
GeneralRe: First attempt at OOD: How do I extend my design? Pin
led mike22-Jun-09 6:41
led mike22-Jun-09 6:41 
AnswerRe: First attempt at OOD: How do I extend my design? Pin
CodingYoshi18-Jul-09 21:18
CodingYoshi18-Jul-09 21:18 
QuestionMVC Pattern question Pin
Quake2Player16-Jun-09 7:43
Quake2Player16-Jun-09 7:43 
AnswerRe: MVC Pattern question Pin
led mike16-Jun-09 11:48
led mike16-Jun-09 11:48 
GeneralRe: MVC Pattern question Pin
Quake2Player16-Jun-09 12:16
Quake2Player16-Jun-09 12:16 
GeneralRe: MVC Pattern question Pin
led mike17-Jun-09 4:50
led mike17-Jun-09 4:50 
AnswerRe: MVC Pattern question Pin
Leslie Sanford18-Jun-09 7:50
Leslie Sanford18-Jun-09 7:50 
GeneralRe: MVC Pattern question Pin
Quake2Player18-Jun-09 8:17
Quake2Player18-Jun-09 8:17 
GeneralRe: MVC Pattern question Pin
Leslie Sanford18-Jun-09 8:21
Leslie Sanford18-Jun-09 8:21 
GeneralRe: MVC Pattern question Pin
Quake2Player18-Jun-09 8:30
Quake2Player18-Jun-09 8:30 
GeneralRe: MVC Pattern question Pin
Leslie Sanford18-Jun-09 8:59
Leslie Sanford18-Jun-09 8:59 
AnswerRe: MVC Pattern question Pin
CodingYoshi7-Jul-09 17:28
CodingYoshi7-Jul-09 17:28 
GeneralRe: MVC Pattern question Pin
Quake2Player7-Jul-09 17:37
Quake2Player7-Jul-09 17:37 
QuestionClient Server Protocol Definition - Best Practices Pin
Member 404718314-Jun-09 17:16
Member 404718314-Jun-09 17:16 
AnswerRe: Client Server Protocol Definition - Best Practices Pin
Jimmanuel15-Jun-09 0:40
Jimmanuel15-Jun-09 0:40 
AnswerRe: Client Server Protocol Definition - Best Practices Pin
led mike15-Jun-09 4:28
led mike15-Jun-09 4:28 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.