A sample three-tier project [feedback required]

Student?

Pretty standard stuff. Nothing wrong with it.
 
Last edited:
Student yes. Looking for some decent source material to learn from.

Thanks Hamster.
 
Student yes. Looking for some decent source material to learn from.

Thanks Hamster.
Project has three layers: UI, Business and DataAccess. The idea is to separate them and talk to each other in a standard way:
UI <-> Business <-> DataAccess. UI never talks to DataAccess.

You also shouldn't share entity classes between UI and DataAccess. Let's say you have a person table and the DataAccess returns a Person object, that Person class should be translated/mapped to another class that was design for UI use. It is more work (overkill even) but it helps to think about it this way: if your DataAccess changes to use a web service instead of a database, why should your UI be affected?

In that example the guy returns datarows and datatables from his DataAccess layer which means he is sort of doing it already. Once you start using something like Dapper which makes your DB coding g life much easier you'll need to keep this in mind and enforce it.
 
That is a very helpful explanation thanks. I will chew over that for a while. For a while now I have not been happy with my approach of UI accessing the database either directly or by calling a data access class, something has been missing, just not been happy with my coding efficiency (lack of it).

I've naturally been gravitating towards this 3-tier approach without even realizing it. The Business Layer is the missing piece in the puzzle, now to sit down with this sample project and start from there.
 
Last edited:
That is a very helpful explanation thanks. I will chew over that for a while. For a while now I have not been happy with my approach of UI accessing the database either directly or by calling a data access class, something has been missing. I've naturally been gravitating towards this 3-tier approach without even realizing it. The Business Layer is the missing piece in the puzzle, now to sit down with this sample project and start from there.
The inverse is true too. If your UI changes, why should your business and DataAccess change? UpdateUser() stays UpdateUser(). This is where interfaces come in. Your UI has access to an IBussiness interface and when you click a button it only calls a method on that interface.

Anyway, you'll cover this as you carry on with your studies
 
Is this MVC basically?

No MVC is a client side methodology but it applies similar principles in that there is a clear separation between components. If you think about writing code in a enterprise/cloud/etc environment you will allways gravitate towards reusable components no matter if it is OOP/SOA/MVC/Entities/etc.
 
Not sure. All my MVC googles have turned up ASP.NET

I'm not sure what the WinApp equivalent is but this project ^ seems to be it.

Not entirely. Same principle, but better to work with.

No MVC is a client side methodology but it applies similar principles in that there is a clear separation between components. If you think about writing code in a enterprise/cloud/etc environment you will allways gravitate towards reusable components no matter if it is OOP/SOA/MVC/Entities/etc.

Just tell me, the laravel framework I use that is MVC right?

I just want to make sure I understand it all.
 
Just tell me, the laravel framework I use that is MVC right?

I just want to make sure I understand it all.
Google and the Laravel website says it's MVC yes. Not to be confused with 3 tier.
 
Not sure. All my MVC googles have turned up ASP.NET

I'm not sure what the WinApp equivalent is but this project ^ seems to be it.

ASP.Net is a Web development thing. You can easily create MVC Web apps using C# and asp.net.
 
Student yes. Looking for some decent source material to learn from.

Thanks Hamster.
WTF you are a student???
Project has three layers: UI, Business and DataAccess. The idea is to separate them and talk to each other in a standard way:
UI <-> Business <-> DataAccess. UI never talks to DataAccess.

You also shouldn't share entity classes between UI and DataAccess. Let's say you have a person table and the DataAccess returns a Person object, that Person class should be translated/mapped to another class that was design for UI use. It is more work (overkill even) but it helps to think about it this way: if your DataAccess changes to use a web service instead of a database, why should your UI be affected?

In that example the guy returns datarows and datatables from his DataAccess layer which means he is sort of doing it already. Once you start using something like Dapper which makes your DB coding g life much easier you'll need to keep this in mind and enforce it.

Very interesting. I'll be honest. Never done that before :o
 
WTF you are a student???


Very interesting. I'll be honest. Never done that before :o

Um? In our line of work you are always a student, always learning. I do work full time though.
 
Top
Sign up to the MyBroadband newsletter
X