473,396 Members | 1,702 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

Looking for design patterns suggestions.

I know that the informations I provide may seem limited but maybe
someone has solved similar problem.
I am new in design patterns and I am quite confused who should control
whom, how to configure particular elements checkers, how to make it
all flexible and elegant, how to encapsulate it as much as possible.

There is an API which provide a sequence of data objects.
My task is to check if this sequence is correct:
- does it have proper number of elements
- do the elements have proper data type at particular position in
sequence
- send a formatted message using API if incorrect data type is at some
position in sequence

It would be nothing interesting in this task if the sequence
requirements were fixed but it may vary:
- data type requirements may change on particular positions of
sequence
- sequence length may change (including variation above)
- some checks would be redundant because requirements for some
elements can be very similar

Good news are that the requirements are changeing statically (they are
constant for particular application release).

The sequence is provided by some API function which is state dependent
so the sequence need to be copied into some container. It might look
like this:

// API initialization
// API sequence provider initialization
// some container declaration, let's say 'sequence'

while ( void *pData = API_NextElem() )
sequence.push_back( pData );

// Now I can use some API functions to check particular elements
properities,
// e.g.:
if ( API_IsIntegerData( sequence.at( 0 ) ) )
{
API_Message( "Integer data requeired at position 0" );
return; // application should exit
}

// or

if ( API_GetDataValue( sequence.at( 0 ) ) 3 )
{
API_Message( "Data value at position 0 should be less than 3" );
return;
}

Checkers may be more complicated and may require some information from
API.

I am not looking for complete solution but general suggestions.
Any design pattern suggestions, articles, etc., are welcomed.

Thanks in advance.

May 28 '07 #1
0 1138

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: Jay | last post by:
The GOF text is widely considered the definitive book on the topic. Design Patterns: Elements of Reusable Object-Oriented Softare, Erich Gamma, Richard Helm, Ralph Johnson, John Vlissides ...
1
by: Josh28 | last post by:
Hi We are a group of two chaps just out of undergrad, we created a software to automate the use of Design Patterns. We have put it up at Source Forge--http://dpatoolkit.sourceforge.net/ The...
13
by: John Salerno | last post by:
Here are a few I'm considering: Design Patterns Explained : A New Perspective on Object-Oriented Design (2nd Edition) (Software Patterns Series) by Alan Shalloway Design Patterns C# by...
22
by: Krivenok Dmitry | last post by:
Hello All! I am trying to implement my own Design Patterns Library. I have read the following documentation about Observer Pattern: 1) Design Patterns by GoF Classic description of Observer....
6
by: Orgun | last post by:
Hi, I sent this message to the moderated c++ group too but it is waiting for moderator approval and I wanted to send here too. I am new to Design Patterns. I want to write a simple...
7
by: sck10 | last post by:
Hello, I just started reading about Design Patterns and UML Class Diagrams on the web. Anyway, I have a method that I use to format currency given certain parameters that are supplied from the...
0
by: AMDRIT | last post by:
I am looking for better concrete examples, as I am a bit dense, on design patterns that facilitate my goals. I have been out to the code project, planet source code, and microsoft's patterns and...
5
by: macca | last post by:
Hi, I'm looking for a good book on PHP design patterns for a OOP beginner - Reccommendations please? Thanks Paul
2
by: LarryTheSoftwareGuy | last post by:
Folks, Would love some suggestions re what design patterns to use for this situation. I need to create a simple FSM. A certain login scenario will behave differently based on the following:...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.