Main Page | Namespace List | Class Hierarchy | Class List | File List | Namespace Members | Class Members | File Members | Examples

Y2.h

Go to the documentation of this file.
00001 /*---------------------------------------------------------------------\
00002 |                                                                      |  
00003 |                      __   __    ____ _____ ____                      |  
00004 |                      \ \ / /_ _/ ___|_   _|___ \                     |  
00005 |                       \ V / _` \___ \ | |   __) |                    |  
00006 |                        | | (_| |___) || |  / __/                     |  
00007 |                        |_|\__,_|____/ |_| |_____|                    |  
00008 |                                                                      |  
00009 |                               core system                            | 
00010 |                                                        (C) SuSE GmbH |  
00011 \----------------------------------------------------------------------/ 
00012 
00013    File:       Y2.h
00014 
00015    Author:     Mathias Kettner <kettner@suse.de>
00016    Maintainer: Thomas Roelz <tom@suse.de>
00017 
00018 /-*/
00019 // -*- c++ -*-
00020 
00021 #ifndef Y2_h
00022 #define Y2_h
00023 
00024 
00025 #include <y2/Y2Component.h>
00026 #include <y2/Y2ComponentCreator.h>
00027 #include <y2/Y2ComponentBroker.h>
00028 
00029 /***
00030  * <h2>The YaST2 component architecture</h2>
00031  * 
00032  * <p>The YaST2 system consists of different components. These are
00033  * user interfaces, modules, the system configuration repository (scr),
00034  * the generic workflow manager (wfm), the scr agents and possibly
00035  * other types. 
00036  *
00037  * <p>Each of the components can be realized in different ways, for example
00038  * as independent Unix executables, as processes communicating over a fixed
00039  * socket, as shared library plugins, as statically linked object files or
00040  * as YCP scripts.
00041  * 
00042  * <p>The Y2 library provides a framework for unifying all these kinds of
00043  * component types into a single interface called @ref Y2Component. It also
00044  * provides a generic frontend containing a main function, and the class 
00045  * @ref Y2ComponentBroker, whose task is to create the interfaces to components
00046  * when needed.
00047  *
00048  * <p>It is possible to link <i>all</i> YaST2 components together to one big monolith and
00049  * even statically link that! The components can communicate by exchanging pointers to
00050  * data structures rather that having to parse ASCII strings. And just one process is needed.
00051  * On the other hand it is possible to split it up into many self contained binaries and it
00052  * nevertheless has the same functionality. You very well can do it in both ways the same
00053  * time and provide single isolated binaries as well as clusters of components, that need
00054  * not be disjunct.
00055  *
00056  * <h2>The generic frontend (GF)</h2>
00057  * 
00058  * <p>The liby2 provides a main function. A component linked to liby2
00059  * therefore need not and cannot have its own main function. This
00060  * generic main function does:
00061  *
00062  * <ul>
00063  *   <li>parse the commandline in a way consistent to all components</li>
00064  *   <li>find the server and the client component regardless, whether they are realized
00065  *       as external programs, 
00066  *       shared library plugins, YCP scripts or objects that are linked to the main binary</li>
00067  *   <li>parameter checking (not yet implemented)
00068  *   <li>launches the server and the client component with the correct paramters</li>
00069  *   <li>start the communication between client and server</li>
00070  * </ul>
00071  * 
00072  * <p>A YaST2 binary does always consist of the generic frontend and zero or more
00073  *  components that are linked in. The binary <tt>y2gf</tt> just contains the frontend
00074  *  and the builtin components <tt>cat</tt> and <tt>stdio</tt>. <tt>cat</tt> is
00075  *  a server component that can be used instead of a user interface. It simply prints
00076  *  all commands it gets to stdout and waits for the answer at stdin. <tt>stdio</tt>
00077  *  works similary, but is a client.
00078  *
00079  * <p>The general synopsis of a call of a YaST2 binary is:
00080  * <pre>y2gf [server] client [client-options] [server-options]</pre>
00081  * 
00082  * <p><font size="-1">( Please don't ask yet, why the server-options are stated <i>after</i>
00083  * the client options. We will see later. )</font> </p>
00084  * 
00085  * <p>An example would be:
00086  * <pre>y2gf qt mainmenu</pre>
00087  *
00088  * <p>This call would use the component <tt>qt</tt>, which is the Qt-lib base graphical
00089  * user interface, as display server and start the module <tt>mainmenu</tt>.
00090  *
00091  * <p>If the name of the YaST2 binary is not equal to <tt>y2gf</tt>, then the name
00092  * without the <tt>y2</tt> is used as the name of the first component:
00093  * <pre>y2qt mainmenu</pre>
00094  * <p>This call does the same as the upper one. The generic frontend contained in <tt>y2qt</tt>
00095  * first looks for a builtin (linked against) component named <tt>qt</tt>. If it finds one 
00096  * <i>in itself</i>, it does not have to launch an external program component.
00097  *
00098  * <h3>Server options</h3>
00099  * <p>Every command line argument
00100  */
00101 
00102 #endif // Y2_h

Generated on Fri Nov 9 18:15:22 2007 for yast2-core by doxygen 1.3.6