473,657 Members | 2,430 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

policy based design, and traits

please be so kind and direct me to as many sources as you can regarding the
*subject* matter. i'm new to the topic and would like to learn as much as
possible.

thank you in advance

martin
Oct 14 '05 #1
4 2039
Martin Vorbrodt wrote:
please be so kind and direct me to as many sources as you can
regarding the *subject* matter. i'm new to the topic and would like
to learn as much as possible.


Andrei Alexandrescu, "Modern C++ Design", get a copy. When you have
gone through it, ask more questions.

V
Oct 14 '05 #2
Victor Bazarov wrote:
Martin Vorbrodt wrote:
please be so kind and direct me to as many sources as you can
regarding the *subject* matter. i'm new to the topic and would like
to learn as much as possible.


Andrei Alexandrescu, "Modern C++ Design", get a copy. When you have
gone through it, ask more questions.


_MC++D_ is indeed the primary resource for policy-based design. You
could also read Alexandrescu's columns in the _C/C++ Users Journal_ in
which he not infrequently touches on the subject: cuj.com. As for
traits and such, you could look into Boost's documentation: boost.org.
Then there's always comp.lang.c++.m oderated, comp.lang.c++, and
comp.std.c++ where Alexandrescu and other knowledgeable folk lurk.

Cheers! --M

Oct 14 '05 #3
"Victor Bazarov" <v.********@com Acast.net> wrote in message
news:Nd******** ************@co mcast.com...
Martin Vorbrodt wrote:
please be so kind and direct me to as many sources as you can
regarding the *subject* matter. i'm new to the topic and would like
to learn as much as possible.


Andrei Alexandrescu, "Modern C++ Design", get a copy. When you have
gone through it, ask more questions.

V


started reading it today (for the second time i must add, last time got to
chapter six and, well, got a little confused. but that was a while ago).
i'll get back with more questions in few days, of that you can be cartain:)

Martin V
Oct 14 '05 #4
Martin Vorbrodt wrote:
"Victor Bazarov" <v.********@com Acast.net> wrote in message
Andrei Alexandrescu, "Modern C++ Design", get a copy. When you have
gone through it, ask more questions.


started reading it today (for the second time i must add, last time got to
chapter six and, well, got a little confused. but that was a while ago).
i'll get back with more questions in few days, of that you can be cartain:)


The first four chapters of MC++D are the tools used throughout the
book, and when I read the book, I went through the first two chapters
and skimmed the next two. Then I jumped to the chapters on factories (8
and 9) and then smart pointers (7), which were the parts that I was
interested in at the time. I referred back to chapter 3 on typelists
when they became important in chapter 9 and to chapter 4 on small
object allocation when it came up in chapter 7, but not before.

I'd suggest doing something similar: read part of the "Techniques " in
the first four chapters, then jump to the application of them that is
most relevant for you. If none of the applications stand out, go to
chapter 8, which presents a very useful and simple design pattern, the
object factory. (Smart pointers are more universally relevant, but that
chapter is a bit more complex and requires chapter 4 also.) Once you
have an idea of how things work, you'll be better able to get your mind
around the more complex material presented in the other chapters.

It's also handy to have _Design Patterns_ handy, since MC++D references
it a lot.

BTW, Alexandrescu with David Held wrote a series four articles fixing a
bug in the exception safety of the smart pointer from chapter 7
starting in October 2003 in the CUJ Online Experts Forum and continuing
in the magazine in the December 2003 issue
(http://www.cuj.com/documents/s=8890/.../alexandr.htm).

Cheers! --M

Oct 14 '05 #5

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

Similar topics

0
1497
by: mjm | last post by:
Folks, I am encountering the following problem when using templates in writing a library: since template functions are only instantiated at the point of use classes don't have to follow well defined interfaces anymore. When the template is instantiated the compiler looks for all the pieces and if it finds them all you have your function and if not you have a compiler error.
0
1352
by: rjoshi | last post by:
There is a nice article about practicle usage of Policy Base Design at http://www.codeproject.com/library/Generic_Pool_Design.asp
8
1892
by: Jon Slaughter | last post by:
I'm reading Alexandrescu's Modern C++ design about the concept of policies. What I'm wondering is if policies are a common design pattern in C++(OOP) nowdays? It seems like a good idea but I'm having a little trouble following along and I'm wondering if I should put in the time to really understand it or if its just a waste because there are better things out there. Like all these things about traits, generics, policies, etc don't mean...
5
3107
by: Martin Vorbrodt | last post by:
I'm designing a Matrix class of 4x4 matrices used in computer graphics. Both OpenGL and Direct3D can take a pointer to array of 16 floats which represent the values in the matrix. OGL takes it in column order, D3D in row order. Therefore row = 2, col = 3 will result in different offset into the float array depending on the API. Here is my basic design test program: #include <iostream> using std::cout; using std::endl;
4
1277
by: Jon Slaughter | last post by:
At the bottom of the page on http://ootips.org/yonat/4dev/smart-pointers.html It is noted that one would use different types of pointers based on different "locations" in the code. What I'm wondering is if there is a way to have the compiler automatically determine which type to use depending on its location such as class T
4
2280
by: Erik Wikström | last post by:
In school (no I will not ask you to do my schoolwork for me) we talked about policy-based design and got an assignment where we got the a code- fragment from a stack-implementation. The idea with the code was that if, when its destructor was called, it still contained any elements it would run 'delete' on them if they were pointers and do nothing if they were not. Our assignment was to reimplement the stack using policies so that the...
1
2204
by: feng | last post by:
Hi, I know this might not be a question for this group but I would give it a try anyway as I couldn't find a better group for my question. I have noticed that there are a lot of articles out side of Microsoft's world that talk about the Rule-based design for business rules, or also known as "Event-condition- action" pattern.
0
1374
by: aaragon | last post by:
Hi everyond. I'm trying to write a library usign policy based design so I can implement different behaviors. One of the behaviors was to define a StoragePolicy. The following code gives the whole idea for a population object: #ifndef _POPULATION_H #define _POPULATION_H #include "gaParameters.h"
3
2013
by: DerrickH | last post by:
I have a template class with three policies: PolicyA, PolicyB, and PolicyC. The design dilemma I am having is that B and C depend upon A, but I would like my Host class to derive from all three. In all three cases I would like to take advantage of enriched policies. template < class PolicyA, template <classclass PolicyB, template <classclass PolicyC class Host: public PolicyA, public PolicyB<PolicyA>, public
0
8392
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
8305
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
8823
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
1
8503
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 Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
8603
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
1
6163
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
1
2726
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
1944
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
2
1604
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.