sql 2005 schema as part of namespace?

Coordinator
Oct 4, 2007 at 3:53 PM
Does it make sense to use the schema (if it exists) as part of the generated object namespace? I am not thinking about dbo but all the custom one. In the AW database they have a sales schema for example. So when we generate the object the namespace would look like: AW.Biz.Sales.Customer for example.
Coordinator
Oct 4, 2007 at 6:11 PM
You can get around this using the NSFx_EntityName to rename them right now. If we decide to do this, we probably would have to make a folder called Sales and create the customer class in there. I'm not sure this is worth it right now - this seems like a one off that probably won't happen often.
Coordinator
Oct 4, 2007 at 8:22 PM


RossCode wrote:
You can get around this using the NSFx_EntityName to rename them right now. If we decide to do this, we probably would have to make a folder called Sales and create the customer class in there. I'm not sure this is worth it right now - this seems like a one off that probably won't happen often.


I agree on the workaround. I think it would be a addition and it would give me a reason to start using schemas in my design!
Oct 4, 2007 at 8:40 PM
It is funny that you bring this up today. We were just discussing this with our DBAs. They were proposing that the tables be dbo and then the application specific stored procedures would then be using a schema for it. This would give them a way to manage objects by knowing what application owned the object. Is anyone using schemas in this way? What kind of pit falls are there if we headed this direction? We also discussed the idea of adding an extended property of our own to indicate the "owning" application. That way they could query the system tables by "owning" application. It would also be nice to get the "owning" application in the comments of the stored procedure.

Since we are discussing the namespace, what about indicating that this is generated? The partial class that has all the generated code has this as port of its filename, it would be able to indicate at the database layer what is being generated and what is not. You could place them in a sub folder in the database project and then maybe just adding "_Generated" to the end of the name. Any thoughts?
Coordinator
Oct 9, 2007 at 12:50 PM


BlacksheepF4U wrote:
It is funny that you bring this up today. We were just discussing this with our DBAs. They were proposing that the tables be dbo and then the application specific stored procedures would then be using a schema for it. This would give them a way to manage objects by knowing what application owned the object. Is anyone using schemas in this way? What kind of pit falls are there if we headed this direction? We also discussed the idea of adding an extended property of our own to indicate the "owning" application. That way they could query the system tables by "owning" application. It would also be nice to get the "owning" application in the comments of the stored procedure.


I haven't used schemas on a project before. After doing a little research they do seem to provide a nice way to group tables together and provide security for those groups. I am not sure that labeling them by the owning application is a good idea. I would much rather see it schemas represent the domain group those tables belong to. The AW sample db has some nice examples of that type of schema naming.


Since we are discussing the namespace, what about indicating that this is generated? The partial class that has all the generated code has this as port of its filename, it would be able to indicate at the database layer what is being generated and what is not. You could place them in a sub folder in the database project and then maybe just adding "_Generated" to the end of the name. Any thoughts?


I think this is a great idea. Joel what do you think?