If you are looking for the link of the presentation shown here it goes:
Wednesday, April 21, 2010
Monday, April 19, 2010
I will be on Techdays 2010 presenting the product I’ve been working on
My session is about software industrialization. I’ve working on a Domain Driven Development framework on Primavera and this is the first public presentation we are doing about it. The last months have been hard but are starting to payoff. You can find better details here:
The age of software industrialization – Combining Domain Driven Design with Code Generation
The description is only available in Portuguese but most of the contents are in United States English.
Our platform will support the product lines of the next generation of Primavera ERPs. We have achieved a high level of automation by using Microsoft DSL tools and T4 templates to generate a very large portion of the software. Our objective is to reach 100% of generated code! This is very very hard but we are highly motivated to pursuit it.
Tuesday, April 13, 2010
Silverlight Serialization – Avoiding having public setters in Properties
In Silverlight you cannot use Reflection to call a non-public setter on a class unless you are in the scope of the class. This has a side-effect in serialization because it requires having public setters for all properties that must be serialized. Well that is not really the case. You can make them internal and use the InternalsVisibleTo attribute to expose those internals to the Microsoft serialization assemblies like this:
1: [assembly: InternalsVisibleTo("System.Runtime.Serialization, PublicKey="
2: + "00240000048000009400000006020000002400005253413100040000010001008D56C76F9E86493"
3: + "83049F383C44BE0EC204181822A6C31CF5EB7EF486944D032188EA1D3920763712CCB12D75FB77E"
4: + "9811149E6148E5D32FBAAB37611C1878DDC19E20EF135D0CB2CFF2BFEC3D115810C3D9069638FE4"
5: + "BE215DBF795861920E5AB6F7DB2E2CEEF136AC23D5DD2BF031700AEC232F6C6B1C785B4305C123B"
6: + "37AB", AllInternalsVisible = true)]
7:
8: [assembly: InternalsVisibleTo("System.ServiceModel.Web, PublicKey="
9: + "00240000048000009400000006020000002400005253413100040000010001008D56C76F9E86493"
10: + "83049F383C44BE0EC204181822A6C31CF5EB7EF486944D032188EA1D3920763712CCB12D75FB77E"
11: + "9811149E6148E5D32FBAAB37611C1878DDC19E20EF135D0CB2CFF2BFEC3D115810C3D9069638FE4"
12: + "BE215DBF795861920E5AB6F7DB2E2CEEF136AC23D5DD2BF031700AEC232F6C6B1C785B4305C123B"
13: + "37AB", AllInternalsVisible = true)]
14:
15: [assembly: InternalsVisibleTo("System.Runtime.Serialization.Json, PublicKey="
16: + "00240000048000009400000006020000002400005253413100040000010001008D56C76F9E86493"
17: + "83049F383C44BE0EC204181822A6C31CF5EB7EF486944D032188EA1D3920763712CCB12D75FB77E"
18: + "9811149E6148E5D32FBAAB37611C1878DDC19E20EF135D0CB2CFF2BFEC3D115810C3D9069638FE4"
19: + "BE215DBF795861920E5AB6F7DB2E2CEEF136AC23D5DD2BF031700AEC232F6C6B1C785B4305C123B"
20: + "37AB", AllInternalsVisible = true)]
Once this is done you can make your setters internal and prevent outside code from calling them.
Have fun,
Tuesday, February 9, 2010
WCF RIA Services – Short Notes – Refreshing data from the server
By default if an Entity arriving from the server has the same Identity has one already in the DomainContexts at the client it is discarded. This behavior can be changed by calling the Load method of the DomainContext giving a MergeOption. It can be:
- MergeOption.OverwriteCurrentValues – What is comming from the server overrides the changes on the client.
- MergeOption.KeepCurrentValues – What is on the client remains the same what comes from the server is discarded.
- MergeOption.KeepChanges – Changes that where made on the client are maintained and everything else is replaced from what is on the server.
Have fun,
WCF RIA Services – Short Notes – Transactions
You can easily integrate transactions in a DomainService by overloading the Submit method on the service and creating the transaction scope there:
1: using (var tx = new TransactionScope( TransactionScopeOption.Required,
2: new TransactionOptions { IsolationLevel = IsolationLevel.ReadCommitted }))
3: {
4: base.Submit(changeSet);
5: tx.Complete();
6: }
The Insert*, Update* and Delete* methods will be called one by one inside the given scope.
Have fun,
WCF RIA Services – Short Notes – Custom logic on solving concurrency errors
DomainServices have solving concurrency errors as a first class scenario. If you want to override the framework default logic you should.
Have an update operation for the entity.
Have a method that handles the concurrency and that:
- Begins with the word Resolve plus the name of the entity.
- Follows the signature template:
1: public bool ResolveEntityA(EntityA current, EntityA original, EntityA store, bool deleteOperation)
Have fun,
WCF RIA Services – Short Notes – Server Side sequence of operations
When the domain service is processing a changeset the sequence of operation is:
Submit – This is the entry point for a submit operation.
AuthorizeChangeSet – In this point the entries in the changeset should be checked against the authorization rules.
ValidateChangeSet – The entries in the changeset should be checked against business rules.
ExecuteChangeSet – The business methods in the domain service are called from this method one by one.
PersistChangeSet – The changeset is persisted.
ResolveChangeSet – If there are any concurrency conflicts they are resolved here.
Kind Regards,
Pedro