Many of us are developing web application and maintaining them as part of the daily routine. But most of them still struggle to maintain the web application due to lack of flexibility and separation of the concern.
In my experience I have seen the business requirements keep changing based on the business priorities and the application should support the changing business needs.
Now, let's get into the business of how to architect an application
1. Deciding the right modeling tool
From last decade or so, so many tools and frameworks are created to address the database requirements. Most of them are like reverse engineering, where you create the database schema and objects and then build application logic on top of it.
Because of rapid changes in business requirements, it is very difficult to maintain the database changes. For ex, there might be one additional property you might want to add or change existing property characteristics you always have to do impact analysis on all the places where the dependency is created and it very hard to do in very big projects.
If it is a small or medium-seized project, prefer creating the database and object by hand and then use the ORM frameworks to generate the business objects to use them in your application logic.
If it is large sized project, prefer using modeling tools to model the data model. Good thing about the data modeling tools are that the objects are integrated and easy to maintain.
Some of the modeling tools are Microsoft Entity Framework and Deklarit. You can visit their home page to get more information.
2. Layering the DAL
DAL (Data Access Layer) is the separate layer whose responsibility is to handle the database operations. Data operations can be CRUD (creation, read, update or update.) operations.
Now if you are wondering how to create the DAL layer, here you go.
- If you are decided to use the ORM frameworks, they will generate the data objects based on your database objects. You don't have to write single line of code to create and maintain the data access library.
- If you have decided the data modeling tool, then the data modeling tool will be responsible to create the database objects and generate the DAL library. Same DAL library can be used to do the CRUD operations.
3. Layering BLL
Now we come to the important piece of the business logic. BLL (Business Logic Layer or sometime people call it as BAL) is the layer where the application business logic will be present.
Why do I really bother about separating the business layer from data access layer?
Answer is that there may be some decision to change your database and that shouldn't affect your written business logic. Rewriting or tweaking the data access logic should make sure it works for new database support. Data modeling tool will be used to achieve with less effort.
Similarly, if the business logic changes that shouldn't affect the written data access logic. Keeping them separate and independent will be maintainable for long term.
4. Presentation Layer
Since we created the foundation of creating the DAL and BLL, any type of application can be built on top of it. Is there specific attention required for types of applications? Answer is yes and no. It really depends on the business requirement. Since we are dealing how to architect an application but not what type of application we can leave it here.
Now assume you are creating any type of interactive application (which has user interface), you will have the below characteristics:
- User interface
- Presentation logic that handles the UI events
- Some workflow to process your input and return the output.
Now because we have 3 concerns the UI, application processing logic and the workflow, all three should be separated. Because in future, UI can be changed from time to time. So the code you will write to handle the presentation and calling the workflow to process the request should be separated to handle the smooth transition of changing the UI.
5. Logging
Now as the application is layered and built, now you need to have the essential tools to support the maintainability of the application. Logging is one among them.
So what is Logging?
Logging is a mechanism through which log your exception messages or unhandled exceptional conditions etc in a common place.
Why it is needed?
If something is failing, say for example the record insertion or updating is failing in the DAL or if there is some business logic fails in the BAL how will you come to know as a technical person to fix the problem.
How do I log the message?
You can use simple frameworks like Log4Net or Elmah to do that. Logging the messages can be stored from simple storage like text file to the secure storage like database. Some of the logging framework supports logging the message and send email on the same.
6. Auditing
Another piece of tool for data maintainability is the auditing.
What is auditing?
Auditing is a process or mechanism to record the data changes happened on a given record.
Why it is needed?
Storing the business records in the database is part of the technical requirements. But tomorrow if you want to know what values are changed and by whom is very important information to support the argument.
How to I do the auditing?
Auditing can be either done from the application layer or from the database level.
Conclusion
So now, I gave very high-level of basic architecture view you should be able to understand how important is the layering is.
I will address architecting the specific type of applications in my next articles.
- 大小: 13.8 KB
分享到:
相关推荐
It shows you how to manage an application's assets and how to implement the Model-View-Controller pattern. The next few chapters demonstrate how to develop the features of your social network. It ...
It shows you how to manage an application's assets and how to implement the Model-View-Controller pattern. The next few chapters demonstrate how to develop the features of your social network. It ...
This book takes you on a step-by-step journey and teaches you how to adapt an application to fit into the MVVM design. What You Will Learn Gain the fundamentals of MVVM Visualize MVVM as a design ...
Enterprise Rails is indispensable for anyone planning to build enterprise web services.... Enterprise Rails teaches you how to architect scalable Rails applications from the ground up.
This chapter will guide you in how to look at your microser- vices through the eyes of an architect, an application engineer, and a DevOps engineer. Chapter 3 introduces you to how to manage the ...
This book takes you on a step-by-step journey and teaches you how to adapt an application to fit into the MVVM design. What You Will Learn Gain the fundamentals of MVVM Visualize MVVM as a design ...
helping memory management act at its best, and correctly deciding how to architect a complex application. Do not panic if your applications start consuming a lot of memory; instead spot the leak and ...
If you are a .NET developer with an understanding of application development, but want to learn how to optimize the performance of your applications, this is the book for you. Basic knowledge of C# is...
Ideal for enterprise architects, IT managers, application architects, and data engineers, this book shows you how to overcome the many challenges that emerge during Hadoop projects. You'll explore the...
JBoss in Action is the first book to focus on teaching readers in detail how to use the JBoss application server. Unlike other titles about JBoss, the authors of JBoss in Action go deeper into the ...
Leverage the popular ALM tools, application insights, and their usage to monitor performance, testability, and optimization tools in an enterprise Explore various authentication models such as social ...
If you’re an application architect, you may measure performance in broader metrics. You may be more concerned about resource utilization than straight-line execution. You might pay more attention to...
The author, a senior solutions architect and Principal Technical instructor with Pivotal, the company behind the Spring Framework, shares his experience, insights and first-hand knowledge about how ...
This document talks about the application programming interfaces (APIs) that enable you to embed data integration capabilities in an enterprise application Advanced Workflow Guide: Advanced workflow...
Plus, you’ll learn how to build a prototype application from scratch and discover how to refactor the prototype into a properly designed, enterprise-level application. With the help of step-by-step...
Learn how to leverage microservices and Docker to drive modular architectural design, on-demand scalability, application performance and reliability, time-to-market, code reuse, and exponential ...
Effective Use of Microsoft Enterprise Library is that roadmap. <br/>Microsoft application development lead architect Len Fenster explains exactly how to build applications using Enterprise ...
Effective Use of Microsoft Enterprise Library is that roadmap. <br/>Microsoft application development lead architect Len Fenster explains exactly how to build applications using Enterprise ...