Hello Guys,
Today i was trying to understand CSLA Framework written by Rockford Lhotka, thought would be nice to share with you guys. Also i am working on one of the basic CRUD app using CSLA framework so i will post it soon here too.
What is Business Objects - as CSLA is business object based framework?
In traditional 3 tier programming you have three logical layers or tiers. You have a presentation layer which is the User Interface, the bottom layer would be the database layer. The middle layer would be the business objects layer. As pointed out above the business objects should be abstracted in that the site might not be about business at all. It is a layer of abstraction that makes it easier to make changes to the presentation layer or to switch to a different data source.
If your user interface level has no or very little code behind it. It makes it easier for designers to work with programmers. The designers can change the look and feel of the site without the programmers having to do a substantial rewrite of the code that makes that site work. With the business objects layer you do the heavy listing of the site. You make calls into the database layer without the business object knowing whether your database layer is in XML or relational database. And the business object layer then would update a response to the UI layer. Typically the example used is for a bank transaction. In the user interface a client enters the amount he would like to transfer from his savings account to his checking account.
The business object layer will contain the business rules for the bank . That means it will check the balance of the users savings account and make sure the amount to transfer does not exceed the balance of the account. The business layer will contain the classes that actually calculate the new balances for both the savings account and the checking account and it will alert the database layer to update the database.
What is CSLA(Component-based Scalable Logical Architecture) Framework ?
CSLA .NET is a software development framework that helps you build a reusable, maintainable object-oriented business layer for your app.The framework enables developers to leverage the power of object-oriented design as the basis for creating powerful applications. Business objects based on CSLA automatically gain many advanced features that simplify the creation of Windows, web, service, and mobile interfaces.
CSLA .NET allows great flexibility in object persistence, so business objects can use virtually any data sources available. The framework supports 1-, 2- and n-tier models through the concept of mobile objects. This provides the flexibility to optimize performance, scalability, security and fault tolerance with no changes to code in the UI or business objects.
What are the Benefits of using CSLA ?
1.CSLA takes away the burden of having to create a large programming infrastructure every time you undertake an enterprise application. Once you buy into CSLA, you never again have to worry about creating remoting architecture, implementing databinding support, or working consistently with hierarchical data in your objects. CSLA provides all the plumbing that you need.
2.We have discovered that once CSLA became our application's development framework, it was very hard for members of the development team to stray too far from the pack in terms of coding style and design implementation. For example, after a while we learned that if we wanted to see how another developer was doing data retrieval, we only needed to look in the object's DataPortal_Fetch()method. Also, the creation of collections of objects and the saving of hierarchical data became a consistent experience. We did not have to devote precious design-time discussion to how we were going to make and support collections. CSLA gives us a roadmap that eventually becomes a design standard.
3.Remember that CSLA stands for Component-based Scalable Logical Architecture. Not to be trite, but Scalability is CSLA's second name. The fact that data source location and network protocol are declarative settings in the app/web.config file provides a lot of leeway when it's time to move an application from working with data by way of a web service, to the faster-running operational environment provided by Enterprise Services. Granted, CSLA isn't magic, but it does reduce overhead in terms of environmental programming.
4.CSLA ships with a bunch of utility objects that make working with the framework a lot easier. Listing 7 demonstrates the use of the ObjectAdapter, one of these objects. The ObjectAdapter will transform a strong-typed collection of CSLA objects into a data source.
What are the cons of CSLA ?
1.Using CSLA is not intuitive. The framework has a considerable learning curve and requires a significant investment of time. You need practice to get the hang of it, particularly to take full advantage of the DataPortal functionality. CSLA is best suited for large projects in a distributed environment that will have a shelf life of many, many years. Mr. Lhotka's books are an excellent resource, but they are filled with detail, and every detail has an implication in terms of application design and writing CSLA code. Keep in mind that skipping a detail in the short term might come back to haunt you later. However, once you've got some skill with CSLA, the savings in heads-down programming time and quality assurance expense are significant.
2.CSLA makes extensive use of the factory design pattern, reflection, serialization, generics, static methods, and programming using abstract classes. These are not beginner's topics. If you're planning to use CSLA, you'll find it advantageous to have at least one experienced person on your development team—someone who can write efficient, effective, advanced object-oriented code in the .NET environment. Otherwise, you run the risk of getting compile-time errors that are difficult to resolve, and runtime behavior that you won't understand.
3.CSLA is a framework, not a methodology—you have to learn it. And it's best to use the framework in the way it is meant to be used. You can use CSLA piecemeal, but in order to get full long-term flexibility and benefit from the framework, particularly in terms of the DataPortal mechanism, it's best to use all the parts of the framework all of the time. Otherwise you run the risk of having to go back and refactor code—definitely antithetical considering that avoiding refactoring down the road is what CSLA is all about.
4.CSLA is comprehensive but not magical. Although its benefit is that a lot of "plumbing" is already in place, you still need to know how to do things such as change an object state from new to old (invokeMarkNew()); how to declare an object as a child of a parent (invoke MarkAsChild()); and how to configure your environment so that a CSLA client application can work with a CSLA application server. These are detail-rich activities. Yet once you learn what you need to, you'll move much more quickly in subsequent iterations of your enterprise application.
Stay tuned for the simple demo of CSLA in near future.
Today i was trying to understand CSLA Framework written by Rockford Lhotka, thought would be nice to share with you guys. Also i am working on one of the basic CRUD app using CSLA framework so i will post it soon here too.
What is Business Objects - as CSLA is business object based framework?
In traditional 3 tier programming you have three logical layers or tiers. You have a presentation layer which is the User Interface, the bottom layer would be the database layer. The middle layer would be the business objects layer. As pointed out above the business objects should be abstracted in that the site might not be about business at all. It is a layer of abstraction that makes it easier to make changes to the presentation layer or to switch to a different data source.
If your user interface level has no or very little code behind it. It makes it easier for designers to work with programmers. The designers can change the look and feel of the site without the programmers having to do a substantial rewrite of the code that makes that site work. With the business objects layer you do the heavy listing of the site. You make calls into the database layer without the business object knowing whether your database layer is in XML or relational database. And the business object layer then would update a response to the UI layer. Typically the example used is for a bank transaction. In the user interface a client enters the amount he would like to transfer from his savings account to his checking account.
The business object layer will contain the business rules for the bank . That means it will check the balance of the users savings account and make sure the amount to transfer does not exceed the balance of the account. The business layer will contain the classes that actually calculate the new balances for both the savings account and the checking account and it will alert the database layer to update the database.
What is CSLA(Component-based Scalable Logical Architecture) Framework ?
CSLA .NET is a software development framework that helps you build a reusable, maintainable object-oriented business layer for your app.The framework enables developers to leverage the power of object-oriented design as the basis for creating powerful applications. Business objects based on CSLA automatically gain many advanced features that simplify the creation of Windows, web, service, and mobile interfaces.
CSLA .NET allows great flexibility in object persistence, so business objects can use virtually any data sources available. The framework supports 1-, 2- and n-tier models through the concept of mobile objects. This provides the flexibility to optimize performance, scalability, security and fault tolerance with no changes to code in the UI or business objects.
What are the Benefits of using CSLA ?
1.CSLA takes away the burden of having to create a large programming infrastructure every time you undertake an enterprise application. Once you buy into CSLA, you never again have to worry about creating remoting architecture, implementing databinding support, or working consistently with hierarchical data in your objects. CSLA provides all the plumbing that you need.
2.We have discovered that once CSLA became our application's development framework, it was very hard for members of the development team to stray too far from the pack in terms of coding style and design implementation. For example, after a while we learned that if we wanted to see how another developer was doing data retrieval, we only needed to look in the object's DataPortal_Fetch()method. Also, the creation of collections of objects and the saving of hierarchical data became a consistent experience. We did not have to devote precious design-time discussion to how we were going to make and support collections. CSLA gives us a roadmap that eventually becomes a design standard.
3.Remember that CSLA stands for Component-based Scalable Logical Architecture. Not to be trite, but Scalability is CSLA's second name. The fact that data source location and network protocol are declarative settings in the app/web.config file provides a lot of leeway when it's time to move an application from working with data by way of a web service, to the faster-running operational environment provided by Enterprise Services. Granted, CSLA isn't magic, but it does reduce overhead in terms of environmental programming.
4.CSLA ships with a bunch of utility objects that make working with the framework a lot easier. Listing 7 demonstrates the use of the ObjectAdapter, one of these objects. The ObjectAdapter will transform a strong-typed collection of CSLA objects into a data source.
What are the cons of CSLA ?
1.Using CSLA is not intuitive. The framework has a considerable learning curve and requires a significant investment of time. You need practice to get the hang of it, particularly to take full advantage of the DataPortal functionality. CSLA is best suited for large projects in a distributed environment that will have a shelf life of many, many years. Mr. Lhotka's books are an excellent resource, but they are filled with detail, and every detail has an implication in terms of application design and writing CSLA code. Keep in mind that skipping a detail in the short term might come back to haunt you later. However, once you've got some skill with CSLA, the savings in heads-down programming time and quality assurance expense are significant.
2.CSLA makes extensive use of the factory design pattern, reflection, serialization, generics, static methods, and programming using abstract classes. These are not beginner's topics. If you're planning to use CSLA, you'll find it advantageous to have at least one experienced person on your development team—someone who can write efficient, effective, advanced object-oriented code in the .NET environment. Otherwise, you run the risk of getting compile-time errors that are difficult to resolve, and runtime behavior that you won't understand.
3.CSLA is a framework, not a methodology—you have to learn it. And it's best to use the framework in the way it is meant to be used. You can use CSLA piecemeal, but in order to get full long-term flexibility and benefit from the framework, particularly in terms of the DataPortal mechanism, it's best to use all the parts of the framework all of the time. Otherwise you run the risk of having to go back and refactor code—definitely antithetical considering that avoiding refactoring down the road is what CSLA is all about.
4.CSLA is comprehensive but not magical. Although its benefit is that a lot of "plumbing" is already in place, you still need to know how to do things such as change an object state from new to old (invokeMarkNew()); how to declare an object as a child of a parent (invoke MarkAsChild()); and how to configure your environment so that a CSLA client application can work with a CSLA application server. These are detail-rich activities. Yet once you learn what you need to, you'll move much more quickly in subsequent iterations of your enterprise application.
Stay tuned for the simple demo of CSLA in near future.
No comments:
Post a Comment