Basic n-tier architecture question...

G

Guest

I understand that there are a several ways to architect an n-tier solution,
but I think we can keep it simple in our projects...they tend to be pretty
small. I just need to know if I have the right idea.

1) We're building ASP.NET apps and I intend to add WinForm apps to the mix.
2) We're using SQL Server 2005 for the backend.
3) I'm adding .NET Class Libraries for the business layer.

Here's what I'm unsure of. For the business layer, is the basic idea to have
static methods in my class which I call from the front end?

Example:

Web page -> MyBusinessObject.GetNumClients() -> call SQL Server sproc
Web page -> MyBusinessObject.SaveClientName( name ) -> call SQL Server sproc

and so on. Should look the same for WinForm apps.

Is this the right idea? Again, I don't THINK we need anything elaborate.
Just something that will perform reasonably well and allow reuse of our calls
to the database.

Thanks,
Jay
 
M

Michael Nemtsev

Hello Jay,

Your queries to DB will be pooled, and u can create thread pool to add more
flexibility.
But what do u mean there by "static calls"?

JW> I understand that there are a several ways to architect an n-tier
JW> solution, but I think we can keep it simple in our projects...they
JW> tend to be pretty small. I just need to know if I have the right
JW> idea.
JW>
JW> 1) We're building ASP.NET apps and I intend to add WinForm apps to
JW> the mix.
JW> 2) We're using SQL Server 2005 for the backend.
JW> 3) I'm adding .NET Class Libraries for the business layer.
JW> Here's what I'm unsure of. For the business layer, is the basic idea
JW> to have static methods in my class which I call from the front end?
JW>
JW> Example:
JW>
JW> Web page -> MyBusinessObject.GetNumClients() -> call SQL Server
JW> sproc Web page -> MyBusinessObject.SaveClientName( name ) -> call
JW> SQL Server sproc
JW>
JW> and so on. Should look the same for WinForm apps.
JW>
JW> Is this the right idea? Again, I don't THINK we need anything
JW> elaborate. Just something that will perform reasonably well and
JW> allow reuse of our calls to the database.
JW>
JW> Thanks,
JW> Jay
---
WBR,
Michael Nemtsev :: blog: http://spaces.msn.com/laflour

"At times one remains faithful to a cause only because its opponents do not
cease to be insipid." (c) Friedrich Nietzsche
 
G

Guest

Static methods in the class in the class library, so I can just call the
method I need to whenever I need to call it, without instantiating an
instance...as below:

Web page -> MyBusinessObject.GetNumClients() -> call SQL Server
 
M

Michael Nemtsev

Hello Jay,

it depends on your requirements and constraints. The best colution is don't
have active resources and release them asap
it's the best and simpe aproach. Afterthat try to check performance and test
how much time instantiating component takes
If it's unacceptable for your solution then make it static and keep in memmory,
but be aware - there are a slight complex, because
u need to manage object state between calls (proper locking and thread management)


it's the common solution for your scenario


JW> Static methods in the class in the class library, so I can just call
JW> the method I need to whenever I need to call it, without
JW> instantiating an instance...as below:
JW>
JW> Web page -> MyBusinessObject.GetNumClients() -> call SQL Server
JW>
JW> "Michael Nemtsev" wrote:
JW>---
WBR,
Michael Nemtsev :: blog: http://spaces.msn.com/laflour

"At times one remains faithful to a cause only because its opponents do not
cease to be insipid." (c) Friedrich Nietzsche
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads


Top