|
Try Google, there are lots of ready made packages around.
I must get a clever new signature for 2011.
|
|
|
|
|
I've developed on an application for quiet long now, and it consist of 2 sub systems, 1 for Marketing and 1 for Management. They have an seperated DB each. Now I have an UI that have to pick information in both databases, and I wondered if my controller pattern was correct, since I somehow got the idea that a UI that have connection to both Controller Facades, must be somehow incorrect?
My original setup was like this:
[UI]
------Controllers------
[Business Logic]
------Datacontext------
MarketingDB | ManagementDB
I don't know if it give you any sense? The controller on the drawing consist of the 2 controllers described above. Would it be right to make an on-top controller and call that one FrontController, so ALL UI's are connection to the FrontController no matter if they are Marketing UIs or Management UIs? Imo that gives you the ultimate of low coupling between UI and business layer, and lowest coupling between the Controllers and the UI layer, but I don't know if this is 'correct' or wrong? What is your oppinion???
I have two drawings to show the concept I wanted to do:
http://img192.imageshack.us/i/controllerdomaincontrol.jpg/[^]
ONLY FrontController:
http://img62.imageshack.us/i/controllerfrontcontroll.jpg/[^]
Which one would you prefer as correct architecture? And why?
|
|
|
|
|
I prefer front controller because by adding a layer you can abstract your sub controllers and stimulating immagination
Piccadilly Yum Yum
|
|
|
|
|
But won't it just be another class class with duplicated code, containing all the method's from sub-controllers? Or are there any smart way to do it?
|
|
|
|
|
It depends on what is the job of controllers, your architecture is not the only possible, i post a fragment from wikipedia about architectures :
Architecture description languages
Architecture description languages (ADLs) are used to describe a Software Architecture. Several different ADLs have been developed by different organizations, including AADL (SAE standard), Wright (developed by Carnegie Mellon), Acme (developed by Carnegie Mellon), xADL (developed by UCI), Darwin (developed by Imperial College London), DAOP-ADL (developed by University of Málaga), and ByADL (University of L'Aquila, Italy). Common elements of an ADL are component, connector and configuration.
Piccadilly Yum Yum
|
|
|
|
|
I'm looking for a good way to send notifications to our group when the results of a stored procedure cross a certain threshold. An example would be we have a table that acts as a queue for processing and when the number of records in a processing status is greater than say 10 I would like to receive an email. Is there a better way of doing this other than running a windows service thats polling the database? Thanks in advance.
Greg
modified on Monday, March 7, 2011 5:33 PM
|
|
|
|
|
gbovee wrote: Is there a better way of doing this other than running a windows service thats polling the database?
Since you only get a value when you execute it, there'd be no alternative to polling. You'd have to execute the sproc to see if the value changed.
What does the sproc do? Perhaps the logic can be moved elsewhere?
I are Troll
|
|
|
|
|
Hi,
I know, a well designed architecture should not allow a presentation layer to talk to Data Access Layer. Rather Presentation layer should talk to Business Logic Layer and Business Logic Layer should talk to Data access layer.
In my Data access layer, I have method
public static employee GetEmployee(string emailAddress)
{
using (EmployeeDBDataContext myDbContext = new EmployeeDBDataContext())
{
employee empRecord = myDbContext.employees.Where(aRec => aRec.emailAddress == emailAddress).ToArray().SingleOrDefault();
return empRecord;
}
}
My Presentation Layer's job is to display the properties of the employee object directly to the UI, where I do not even need to write any code for that.
Ok, now, should I create a thin Business Logic layer just to mediate the call of Presentation layer ? Then, it may look very messy as I will have to create a set of methods in BLL duplicating the method signature from DAL. Would you please tell me what could be a better practice ?
modified on Monday, February 28, 2011 5:12 AM
|
|
|
|
|
My first thought looking at this example is that you are awfully trusting. By that I mean that you are trusting input that has not been validated. What happens if email is an empty string, or not a valid email format? This is the type of thing that a well constructed business layer helps to cope with.
|
|
|
|
|
Thanks for your kind reply.
I see. So, I got something to do (validating inputs) for BLL. But, I do the validation in Presentation Layer as the validation is highly related to the UI. For example, if the input is coming from a Slider, then, my validation code will use the Slider's property. If my email address is coming from a text box, then, my Validation code will use the text box property to check. Yes, if I use a Regex to validate an email address, I encapsulate that Regex code in a method in my BLL and call that method from my Validation logic in Presentation layer so that the Presentation layer does not look thick.
Other than validation, is there anything that I may need to know so that I can involve BLL between DAL and Presentation Layer ?
|
|
|
|
|
As the name suggests, the BLL is intended for business logic. If you don't have business logic there is nothing to say you need to have this layer in place. I will say, though, that separating the validation, etc, from the presentation should help to make your app more testable because you can use a tool like nunit to test it, rather than relying on randomly pushing buttons.
|
|
|
|
|
Thank you very much. Now, I got the direction.
|
|
|
|
|
Nadia Monalisa wrote: I know, a well designed architecture should not allow a presentation layer to talk to Data Access Layer. Rather Presentation layer should talk to Business Logic Layer and Business Logic Layer should talk to Data access layer.
According to whom? I don't like these kind of generalizations, as these rules-of-thumb are often used to avoid critical thinking. This specific rule-of-thumb applies to datacentric-applications, not to some game like World of Warcraft. Now to refine your statement; it might be benificial to introduce an abstraction-layer, but it shouldn't be an excercise where you merely duplicate the interface of the datalayer, since that would only eat up your time without providing much benefits.
I got a small app that stores passwords - no datalayer. But the issue-manager does have one, complete with caching (only active when using Xml as a datasource for the datalayer) and logging.
I are Troll
|
|
|
|
|
Thank you very much. I liked your answer.
|
|
|
|
|
Just to play devils advocate, couldn't you argue that the EmployeeDBDataContext is in fact your DAL and the code snippet should be part of the BLL?
If the purpose of the DAL is to allow you to change your data source without affecting the business logic, then I would say the EmployeeDBDataContext achieves this.
"You get that on the big jobs."
|
|
|
|
|
Thank you very much. Yes, thats a good question. Actually, I spent many hours just to find out if that given code snippet should be a part of BLL or DAL. Yes, if I place that snippet in BLL, then, the auto generated LINQ to SQL data context can be the DAL. But, in my BLL, I wanted see the object, not the LINQ to SQL Data context. Because that data context is auto generated and I will have to depend on what Microsoft gives. That is much uncomfortable for me. But, I learned in many place that, Projection should not be done in DAL. Query is a Business Logic. So, the dilemma is kind of a headache and brain killing. Finally I decided to encapsulate the DataContext in DAL and the DAL will not do any projection. DAL will return a single row of a entity or a collection of entity. My BLL will use that collection of entity and use LINQ to Object to do any projection as needed. Even according to that decision, yes, you are right, the above snippet should be in BLL. I should have asked a collection of employees in DAL from BLL and then, the BLL would filter out with the email Address for the desired employee object using LINQ to Object. Hmmm Brain got jammed again
|
|
|
|
|
Definitely with Entity Framework, LINQ to SQL and alike have blurred the borders but even in more traditions architectures, the presentation can still be exposed to the entities which encapsulate the data. There is no reason why a DataGrid in the presentation can't display a collection of entities.
It looks like LINQ is querying your DB but if the DataContext is actually your DAL then LINQ is actually querying your DAL. LINQ just offers a flexible approach to communicating with the DAL as opposed to the old way of having to write a method (in the DAL), for every possible permutation the BLL may request.
So instead of the DAL deciding what the BLL can and can't request. The DAL just provides access to the data source and describes the data. The BLL is free to do what it is supposed to: decide what the presentation can and can't access.
What I have just said may be technically wrong but that's how I see it conceptually.
"You get that on the big jobs."
|
|
|
|
|
My collegues and me just had the same discussion this week.
Why do all the extra work if you could simply directly get your data from the DAL?
Well, I think that this is because sooner or later your client is going to call and they want some new functionality or improvements.
So now you have one form where your employee is called, but in a few months you will have two forms.
If you seperate your DAL from your UI you then could simply re-use that same BLL you used earlier. If you did not seperate your UI from your DAL then you will find that:
A. you need to type some code containing logic (either the LINQ query or validation logic) twice.
Or B. you'll have to make a BLL after all to not resort to solution A.
Solution A is definately not good practice and if you find your clients demands rising you will type more code multiple times.
Even worse, if the client wants the logic you now build into different forms to be slightly different, you are going to have to edit all forms that use this logic, and this is easily forgotten if your application is getting larger.
But you do not want B either, because it will cost you a lot of time (first decoupling DAL from UI and then build the extra layer).
So building that extra BLL might look like a lot of work now, but it could save you a lot of work in the future.
Hope this helped. Good luck with it
It's an OO world.
|
|
|
|
|
Thank you so much for the ideas. Yes, you are right and thats what I am realizing now. At this moment, I am avoiding the extra BLL layer, but I will keep a sharp eye when duplication of code is apparent, and only then, I will add the BLL with only the refactored common methods. So, some of my UI will call DAL and some of my UI will call BLL and over time, depending on BLL will be increased and DAL dependency will decrease.
|
|
|
|
|
I'm interested to find out if it is better to have multiple (8), small services within a solution or to have less but larger services.
Our service currently has around 40 model/dal classes (each model class has a dal class), this represents the bulk of the solution but I can see it growing by another 50% before we are done. I'm debating breaking it into smaller services although there is not logical segregation of the database, it would be breaking it to redusce the size only.
Is there a significant impact on the server to run multiple services. Each client will need all the services b/c of the homogeneous nature of the data.
Never underestimate the power of human stupidity
RAH
|
|
|
|
|
One entry/exit point for your service is better, but then I would dispatch the logic behind it in several classes with each their own logic/domain etc.. So basically a bit of both
|
|
|
|
|
hi all,
for my college project, i need to do a a risk and return analysis for information systems. for that i need to use the cost of some of the software application (a rough number with a valid reference).
can anyone help me to get the cost for some of these applications with a valid reference. even if you have personal experience in this is also fine.
Applications
1. a normal website
2. online consortium
3. marketing and Promotion monitoring system
4. Demand forecasting system
|
|
|
|
|
Without any kind of specifications that info is totally useless for you. I can make a normal website for €100, but also for €1.000.000. That goes for all 4 points.
|
|
|
|
|
if i can give you some basic specifications can you tell me the cost.
please give me some valid reference, so i can cite it. since this is an assignment for my college.
these systems are suggested for a click and mortar company. a book retailer.
1. website
they currently have a website, what needs to be done is they should provide a login to the cargo company who handles their delivery service to check the orders. so they can manage their delivery better.
2. Online consortium
this is a web portal to support online group purchasing. they can join with few other local book retailers. and addition to that this portal should also help them to manage their corporate customers (they have universities and colleges).
3. marketing and promotion monitoring system
this is to manage their promotional activities and to monitor most profitable marketing channel.
4. demand forecasting
based on their sales a system to focus their demands on each branch.
Please help me on this.
|
|
|
|
|
I think the idea may be for YOU to create a high level specification of the requirements for each type of web site, then try and estimate the costs. Asking for references and links is just lazy!
Never underestimate the power of human stupidity
RAH
|
|
|
|
|