.NET Tutorials, Forums, Interview Questions And Answers
Welcome :Guest
Sign In
Register
 
Win Surprise Gifts!!!
Congratulations!!!


Top 5 Contributors of the Month
Easy Web
Imran Ghani
Post New Web Links

Serialization at Persistence - InvokeMethod vs CodeActivity

Posted By:      Posted Date: April 10, 2011    Points: 0   Category :JQuery
 

I've created two workflows - one uses InvokeMethod activities extensively, whereas the other uses only custom CodeActivitys.

I've noticed that when I try to persist the workflow containing the InvokeMethod activities, I have to modify my code to decorate it with [DataContract] and [DataMember] for serialization. However, when I wish to persist the workflow containing only CodeActivities, I do not have to make any changes.

Is this just coincidence, or do CodeActivities always serialize without coding effort?




View Complete Post


More Related Resource Links

Workflow - CodeActivity and Persistence

  

Hi,

 I want to know is there any mechanism/configuration that the persisted workflow instance can resume a code activity from where the lat unloading happened?

Eg: I have a code activity which is long running code and meanwhile I will unload the instance if any service shutdown happened. Now how can i resume/restart the same code activity on loading the workflow?


_mkrs_

Patterns in Practice: The Unit Of Work Pattern And Persistence Ignorance

  

Jeremy Miller continues his discussion of persistence patterns by reviewing the Unit of Work design pattern and examining the issues around persistence ignorance.

Jeremy Miller

MSDN Magazine June 2009


Patterns in Practice: Persistence Patterns

  

Here we examine data persistence patterns to help you determine which best suits your needs. We look at a number of patterns, including the Active Record, the Data Mapper, the Repository, the Identity Map, the Lazy Loading, and the Virtual Proxy.

Jeremy Miller

MSDN Magazine April 2009


Service Station: Serialization in Windows Communication Foundation

  

Windows Communication Foundation supports several serialization mechanisms and provides a simple, interoperable foundation for future service-oriented applications. Here Aaron Skonnard explains it all.

Aaron Skonnard

MSDN Magazine August 2006


Class To Contract: Enrich Your XML Serialization With Schema Providers In The .NET Framework

  

The Microsoft .NET Framework 1.x provided minimal options for mapping classes to schemas and serializing objects to XML documents, making this sort of mapping quite a challenge. The .NET Framework 2.0 changes all this with Schema providers and the IXmlSerializable interface.

Keith Pijanowski

MSDN Magazine June 2006


Advanced Serialization: Format Your Way to Success with the .NET Framework Versions 1.1 and 2.0

  

While .NET offers adequate support for the simple serialization cases, issues arise when you're attempting to support delegates and subscribers, versioning, and class hierarchies. . In addition, the introduction of generics in The .NET Framework breaks new ground in the complexity of the serialization task and the power of serialization tools. This article discusses these issues and related pitfalls, suggests techniques and workarounds that address them, and recommends when and how to best use the new serialization abilities.

Juval Lowy

MSDN Magazine October 2004


Cutting Edge: Binary Serialization of DataSets

  

The ADO. NET DataSet object plays an essential role in most of today's distributed, multitiered applications. Instances of the DataSet class are used to move data across the tiers and to exchange data with external services.

Dino Esposito

MSDN Magazine October 2004


Cutting Edge: Binary Serialization of ADO.NET Objects

  

One of the key elements that makes ADO. NET superior to ADO is the level of integration with XML. In ADO, XML is just an I/O format. In addition, the ADO XML format is totally inflexible and doesn't allow any type of customization.

Dino Esposito

MSDN Magazine December 2002


.NET Column: Run-time Serialization, Part 3

  

This is the third part of my three-part series on serialization. In part one, I showed how to serialize and deserialize objects. I also showed how to define types that allow instances of themselves to be serialized.

Jeffrey Richter

MSDN Magazine September 2002


Is this an example of binary serialization

  

Hi , I have write this code for write error message in .txt file and this code is working fine.

void writeToLogFile(string logMessage)

    {

        string strLogMessage = string.Empty;

        string strLogFile = System.Configuration.ConfigurationManager.AppSettings["logFilePath"].ToString();

        StreamWriter swLog;



        strLogMessage = string.Format("{0}: {1}", DateTime.Now, logMessage);



        if (!File.Exists(strLogFile))

        {

            swLog = new StreamWriter(strLogFile);

        }

        else

        {

            swLog = File.AppendText(strLogFile);

        }



        swLog.WriteLine(strLogMessage);

        swLog.WriteLine();



        swLog.Close();



    }


I want to know is this an example of binary serialization? 
If YES then please inform me from which line the serialization is done? 
If NO then please tell me an example of Binary Serialization ?


XML Serialization & List

  

 Hi all,

 

I'm working on the following code :

 

[System.Runtime.Serialization.DataContractAttribute(Name = "SalesOrder")]
    public partial class SalesOrder
    {

        ...
        private List<OrderLine> orderLineField;

...

public SalesOrder()
        {
            this.orderLineField = new List<OrderLine>();
            this.orderHeaderField = new OrderHeader();
        }

[System.Runtime.Serialization.DataMemberAttribute()]
        public List<OrderLine> OrderLine
        {
            get
            {
                return this.orderLineFi

Bug? : Sgen breaks web-service serialization

  
I am using the noaa weather web service and it works fine if I have not run sgen on the assembly. I have sgen disabled in the project settings and instead run it explicitly in the main build. I run sgen using the command: sgen /a:myassembly.dll /force /compiler:/keyfile:myassembly.snkThis creates an [assembly_name].XmlSerializers.dll and when running the application again, the same call to the web-service fails with the following exception. This is internal to the web-service code so I'm stuck for what to do other than not run sgen:System.InvalidOperationException: There was an error generating the XML document. ---> System.ArgumentException: Item has already been added. Key in dictionary: 'myassembly.gov.weather.www.productType' Key being added: 'myassembly.gov.weather.www.productType' at System.Collections.Hashtable.Insert(Object key, Object nvalue, Boolean add) at System.Collections.Hashtable.Add(Object key, Object value) at System.Xml.Serialization.XmlSerializationWriter.AddWriteCallback(Type type, String typeName, String typeNs, XmlSerializationWriteCallback callback) at Microsoft.Xml.Serialization.GeneratedAssembly.XmlSerializationWriter1.InitCallbacks() at System.Xml.Serialization.XmlSerializationWriter.GetTypeEntry(Type t) at System.Xml.Serialization.XmlSerializationWriter.WriteReferencedElement(String name, String ns, Object o, Type ambientType)

Can this be down with serialization?

  
Let's say I serialize a List<Double>... Can I then deserialize just a "portion" of the serialized List?  If I need to access a range of Doubles in the List, do I have to deserialize the entire list and then access the items I need? I know this is a somewhat strange concept, but it's a real-world requirement. At present, I'm serializing each item in the List using Bitconverter.GetBytes, and storing the 8 bytes into an aggregated byte array which I write to a file. That way, I can later seek into the file, read a range of bytes and then use BitConverter.ToDouble to get the original double values. But using BitConverter.GetBytes on each item in a list of 1,000,000 doubles (resulting in an 8,000,000 byte array) is fairly sluggish (over 1/2 second on 2GHz Core 2 Duo). I suspect it would be faster to serialize the entire List<Doubles> all-at-once rather than item at a time.  But do I then give up the ability to "index" into the stored serialized Doubes if I serialize the List rather than the items in the List?   If I have to deserialize the entire List before I can access individual items in that List, then I'll have to stick with how I'm doing it now... or perhaps find a way to speed-up BitConverter.GetBytes (would this perhaps lend itself to using Parallel.For and allo
Categories: 
ASP.NetWindows Application  .NET Framework  C#  VB.Net  ADO.Net  
Sql Server  SharePoint  Silverlight  Others  All   

Hall of Fame    Twitter   Terms of Service    Privacy Policy    Contact Us    Archives   Tell A Friend