Developing a Smart Architecture, Part 2

Developing an Application Architecture

Overview

This series of articles will walk through the creation of a simple application architecture that can be utilized in programs of nearly any size. The code posted in these articles is for illustrative purposes of concepts and is not intended for direct production use.

Review

In Part 1 of this series, you did a detailed walkthrough of creating intelligent data fields that reduced the reprtitive coding effort while at the same time providing both (simple) validation and change notification.

Part 2: Building Intelligent Entities

Now that you have the ability to create intelligent fields, you need to expand this to creating useful intelligent classes. To begin this process, you will need to re-work a few of your existing classes. This is primarily being done so that you can treat specialized instances of the generic Field class in a unified way. You will create an interface and then update the class to implement this interface.

It is important to note that an EntityCollection is itself an Entity (and therefor a IField). This allows any EntityCollection to be a Field member of an Entity.

Both the Entity and EntityCollection classes at this point are still very simplistic, but are already ready to create some powerful examples.

Enhancing the Invoice Sample Code

First, you must update your Invoice and InvoiceLineItem classes, and enhance them to make use of these entity base classes. This will require the Registration of the various Field objects in the constructor.

Now, you can add a series of events that will ensure that all fields are properly updated when their dependancy fields change. Because these "rules" are inherent in the nature of your Invoice, you will implement them internally to the class and install them during object construction.

Developing a Smart Architecture, Part 2

And there you have it. A very simple implementation that embodies all of the logical operations related to calculating the appropriate iformation related to a simple invoice. This code is very maintainable and easily testable.

Advanced Topics

Although too advanced for details at this point in your design, it is important to realize that there are many alternatives to explicitly coding the fields and explicitly registering them. Full functionallity implementations may use reflection to automatically register applicable fields, and may use Attributes for providing the requirement information. Once you have completed the simple architecture, I will begin to discuss these alternatives.

Conclusion

Even at this early stage, you are able to create "applications" that involve a minimum amount of coding. Even better, the enhancements in the next few installments will not require any (significant) changes to the Invoice sample itself. This is the real "power" of this style of architecture and implementation; you can add power to your library classes (Field, Entity, EntityCollection) as needed, and that capability will become available immediately in both future and past applications.

More Information

The information in these articles is based on the "Smart Architecture" guidance published by Dynamic Concepts Development Corp. This is an open architecture and recommended set of interfaces that can be freely utilized by the developer community. Commercial Vendors are encouraged to produce implementations and tool sets that utilize this architecture.

Top White Papers and Webcasts

The mobile market is white hot. Building a well-crafted product development plan that addresses market research, strategy, design, and development will provide the greatest chance for success. Each phase of an app's lifecycle is critical to the its overall success and feeds into the next step of the process of product development for the app. This white paper examines the five key phases of mobile app creation, one by one, to understand how they work together to help create a successful mobile app.

On-demand Event
Event Date: February 12, 2015
The evolution of systems engineering with the SysML modeling language has resulted in improved requirements specification, better architectural definition, and better hand-off to downstream engineering. Agile methods have proven successful in the software domain, but how can these methods be applied to systems engineering? Check out this webcast and join Bruce Powel Douglass, author of Real-Time Agility, as he discusses how agile methods have had a tremendous …