Click here to Skip to main content
15,896,259 members
Articles / Operating Systems / Windows

Model GUI Logic using MVP, Pub-Sub/State Pattern and XML

Rate me:
Please Sign up or sign in to vote.
3.43/5 (3 votes)
21 Dec 2006CPOL3 min read 29.2K   154   8  
Model form logic using model-view-presenter, state pattern and storing the logic in XML format
<?xml version="1.0" encoding="utf-8" ?>
<FormLogic>
	<Events>
		<Event>
			<Pub Sub="Simpsons" State="BooleanTrue" />
			<Sub Obj="Members" State="MembersOptionSimpsons" />
		</Event>
		<Event>
			<Pub Sub="Friends" State="BooleanTrue" />
			<Sub Obj="Members" State="MembersOptionFriends" />
		</Event>
	</Events>
	<States>
		<State Name="BooleanTrue" Impl="GUIStateMVP.Model.BooleanState">
			<Facet Name="Value" Value="true" />
		</State>
		<State Name="MembersOptionSimpsons" Impl="GUIStateMVP.Model.OptionState" >
			<Facet Name="OptionItem" Value="Homer" />
			<Facet Name="OptionItem" Value="Marge" />
			<Facet Name="OptionItem" Value="Bart" />
			<Facet Name="OptionItem" Value="Lisa" />
			<Facet Name="OptionItem" Value="Maggie" />
		</State>
		<State Name="MembersOptionFriends" Impl="GUIStateMVP.Model.OptionState" >
			<Facet Name="OptionItem" Value="Monica" />
			<Facet Name="OptionItem" Value="Ross" />
			<Facet Name="OptionItem" Value="Joey" />
			<Facet Name="OptionItem" Value="Chandler" />
			<Facet Name="OptionItem" Value="Rachel" />
			<Facet Name="OptionItem" Value="Pheobe" />
		</State>
	</States>
</FormLogic>

By viewing downloads associated with this article you agree to the Terms of Service and the article's licence.

If a file you wish to view isn't highlighted, and is a text file (not binary), please let us know and we'll add colourisation support for it.

License

This article, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)


Written By
Software Developer (Senior) www.wonga.com
Ireland Ireland
I have over 13 Years IT industry experience as Principle/Senior Programmer. I am experienced in .NET/J2EE system design and detailed implementation. I master UML modelling and OO design methodology with a strong C#/C++/Java coding background. I have been in working/managing a distributed project using Agile/Waterfall approach. My business knowledge includes Telecommunication, Financial Investment/Trading, and Banking.

Comments and Discussions