Wednesday, October 22, 2008

Statefull SOA

I am attending a course on WCF (Windows Communication Foundation).

State full services are sometimes not considered 'right' when speaking of Service Oriented Architecture (SOA).

My claim is that state has nothing to do with whether a service can be a good entity in a SOA architecture. You might have a strategy that your services should bee RESTfull, but that has nothing to do with whether your architecture is service oriented or not. REST gives you some other properties (quite useful I might add), but doesn’t influence the architecture towards SOA.

The same goes for callbacks. Even though my telephone company allows people to call me on my phone, I still consider my phone connection to be a service provided to me by my phone company.

Tuesday, October 14, 2008

Plain Validations

For field validations we wanted to avoid the implementation of validation duplicated and spread out over several layers of code.

The right place for validation code would be in the business layer. Actually with plain its more of markup than actual code. What we did was to make an interface for validation attributes to implement. When you need to know if your object is in a valid state, you can ask plain and it will pick up your validation attributes and validate your object. This can be done from your user interface layer or anywhere else you might need it.

As plain just needs you to implement an interface there is no limitation to what kind of validations you can create and have plain use to validate your objects.

We are currently working on a way to define validation messages for each validation and a way to have UI use the validations directly on input fields.

Tuesday, October 07, 2008

Mapping the domain to the web UI

With Plain we wanted some way simple to get data from the domain model to the UI and back.

We already had a mapping implemented from a previous project that could map properties to fields in the UI. What we wanted to change was the dependencies and flexibility of the mapping. Currently all we have to do is name the fields on the form and tell the system what object type to work on to provide CRUD out of the box with plain.

We have one thing left to do on the mapping part. We want lists of values to be filled out automatically. Our Validation component might be what we need to use to be able to do that. More on the Validation component in another post.