Why was the "Mounts" class moved?

This forum is for programmers who have questions about the source code.
Post Reply
User avatar
jordansparks
Site Admin
Posts: 5742
Joined: Sun Jun 17, 2007 3:59 pm
Location: Salem, Oregon
Contact:

Why was the "Mounts" class moved?

Post by jordansparks » Sat Aug 25, 2007 10:59 am

I'm having trouble with understanding why the Mounts class and others were moved into the business layer. It was very organized to have one class for each table all in the same place. Now, if I want to find Mounts, I won't know where to go. It seems less organized to do it like this. My understanding was that the DataInterface classes weren't supposed to be moved. Rather, certain methods were going to be substituted to use the generic business layer classes that were recently added.

Also, the namespace now seems to be OpenDental.Imaging.Business. That does not accurately represent where the file is located in the folder tree. It would actually be at OpenDentBusiness.Imaging.DataInterface, although that doesn't seem right to me either.

Mounts is not accessed from the business layer, so that doesn't seem to be the motivation.
Jordan Sparks, DMD
http://www.opendental.com

fcarlier
Posts: 75
Joined: Tue Jun 19, 2007 3:12 am
Location: Ghent, Belgium

Post by fcarlier » Sat Aug 25, 2007 1:03 pm

I wanted to move all the code that contains the business logic to the business project.

More specifically, I wanted to move the code that does the handling of the images (storing, retrieving,...) to the business project. However, that also requires access to the <TableType>s classes, in various scenarios. For example, when patFolder is first initialized, images may be imported if they already exist in the patient folder. That requires access to Documents class (Documents.InsertMissing is called).

Because of that, I moved the Documents, MountDefs, MountItemDefs,... classes to the business tier. I "forgot" Mounts.

As an compelling argument to why these classes might be beter off in the business tier, imagine you create another front-end (asp.net, GTK, whatever). You'll also need to access the <TableType>s classes.

In what folder they exactly are is less important. I tried to group all classes that work on the imaging functionality together.

Anyway, I hope I could motivate why I think the DataInterface classes might belong to OpenDentBusiness.

Frederik.
Frederik Carlier

User avatar
jordansparks
Site Admin
Posts: 5742
Joined: Sun Jun 17, 2007 3:59 pm
Location: Salem, Oregon
Contact:

Post by jordansparks » Sat Aug 25, 2007 3:03 pm

There are acutally a number of separate issues which are all getting jumbled together in this discussion. Let me try to separate them out:
1. <TableType>s in business project. OK.
2. namespace OpenDental.Imaging.Business even though the files are in OpenDentBusiness. Are you saying this was intentional or not? I guess I didn't even know you could do this.
3. I agree the folder doesn't necessarily have to match the namespace. But how about moving the 6 files that are in OpenDentBusiness\Imaging\Data Interface up into the OpenDentBusiness\Data Interface folder? It would be much more consistent that way.
Jordan Sparks, DMD
http://www.opendental.com

fcarlier
Posts: 75
Joined: Tue Jun 19, 2007 3:12 am
Location: Ghent, Belgium

Post by fcarlier » Sun Aug 26, 2007 2:57 am

I'll reply to each issue seperately:

1. OK, great.
2. Every file can declare it's own namespace. (You can even declare multiple namespaces in one file). I tried -once- to create a namespace for all the imaging stuff. Something like OpenDentBusiness.Imaging, OpenDental.Business.Imaging, or OpenDental.Imaging.Business/OpenDental.Imaging.Data/... . It doesn't really matter. It is merely a left-over of an experiment in the fcarlier branch. I'll change the namespaces back to OpenDentBusiness.
3. Yes, no problem. I'll move them into OpenDentBusiness\Data Interface.

Frederik.
Frederik Carlier

Post Reply