Best practice when writing multi window gtkmm application?

Hello
Anyone here who knows gtkmm? I'm in the progress of learning it, and now I'm stuck. I can't really find a good, clean and _working_ way to add more windows.
For example I want to create a "New project" window where the user have to enter some information, and when the user hits "Create" a new main window opens.
Right now I have done it like this:
main.cpp
int main(int argc, char** argv){
//tk_init(&argc, &argv);
Glib::RefPtr<Gtk::Application> app = Gtk::Application::create(argc, argv, "org.gtkmm.control");
NewProject newProject;
return app->run(newProject);
class NewProject : public Gtk::Window{
private:
//Stuff for the "new_project" window
Gtk::Label locationLabel;
Gtk::Entry locationEntry;
Gtk::Label descriptionLabel;
Gtk::Entry descriptionEntry;
Gtk::Button createButton;
Gtk::Grid grid;
void CreateProject();//Callback for createButton
public:
NewProject();
virtual ~NewProject();
NewProject::NewProject()
locationLabel("Location"),
descriptionLabel("Description and notes"),
createButton("Create")
set_title("New Project");
add(grid);
//gtk_grid_set_column_spacing(GTK_GRID(grid), 5);
//gtk_grid_set_row_spacing(GTK_GRID(grid), 5);
grid.add(locationLabel);
grid.add(locationEntry);
grid.attach_next_to(descriptionLabel, locationLabel, Gtk::POS_BOTTOM, 1, 1);
grid.attach_next_to(descriptionEntry, locationEntry, Gtk::POS_BOTTOM, 1, 1);
grid.attach_next_to(createButton, descriptionLabel, Gtk::POS_BOTTOM, 2, 1);
//locationEntry.show();
createButton.signal_clicked().connect(sigc::mem_fun(*this,
&NewProject::CreateProject));
show_all_children();
show();
NewProject::~NewProject(){
void NewProject::CreateProject(){
gProject.location = locationEntry.get_text();
gProject.description = locationEntry.get_text();
//printf(gProject.location.c_str());
//printf(locationEntry.get_text().c_str());
Glib::RefPtr<Gtk::Application> app = get_application();
//std::vector<Window*> windows = app->get_windows();
MainWindow mainWindow;
app->add_window(mainWindow);
//mainWindow.Create(); //Create just calls show() on the window, tried it as a simple double check, didn't work
hide();
And MainWindow is defined like this:
class MainWindow : public Gtk::Window{
private:
Gtk::Button testLabel;
public:
void Create();
MainWindow();
virtual ~MainWindow();
MainWindow::MainWindow(){
printf(gProject.location.c_str());
if(gProject.location.empty()){
printf("EMPTY");
}else{
printf("Notempty");
set_title("asd");
Gtk::Button testButton("TEST");
add(testButton);
testButton.show();
show();
//this->project = project;
//Show the new project window
//Glib::RefPtr<Gtk::Application> app = get_application();
//app->add_window(newProject);
MainWindow::~MainWindow(){
void MainWindow::Create(){
show();
So, why doesn't the window show up? I know the code is executed, because I can see the printf() output in the terminal. Instead of showing the new window, the application just exits "successfully". If I open MainWindow from main, the windows shows up, but opening NewProject from MainWindow doesn't work.
As I said, I'm pretty new to GTK programming, so I am not completely sure about how I should organize the code, so what I've done here might for what I now, be completely wrong, so please guide me in the right direction I will take a look at other gtkmm applications to see how they have done it, but right now I have a very limited network connections, so I will have to wait until I get home in a few days.
Thank you I can post more code if needed, but I don't think there is any more GTK relevant code in the project.
Edit: I kind of solved this case, since I made the NewProject window as a dialoge, so it's fine for now. However, if somebody have a general solution, it would be nice
Last edited by Hakon (2012-06-22 20:53:42)

Hello
Anyone here who knows gtkmm? I'm in the progress of learning it, and now I'm stuck. I can't really find a good, clean and _working_ way to add more windows.
For example I want to create a "New project" window where the user have to enter some information, and when the user hits "Create" a new main window opens.
Right now I have done it like this:
main.cpp
int main(int argc, char** argv){
//tk_init(&argc, &argv);
Glib::RefPtr<Gtk::Application> app = Gtk::Application::create(argc, argv, "org.gtkmm.control");
NewProject newProject;
return app->run(newProject);
class NewProject : public Gtk::Window{
private:
//Stuff for the "new_project" window
Gtk::Label locationLabel;
Gtk::Entry locationEntry;
Gtk::Label descriptionLabel;
Gtk::Entry descriptionEntry;
Gtk::Button createButton;
Gtk::Grid grid;
void CreateProject();//Callback for createButton
public:
NewProject();
virtual ~NewProject();
NewProject::NewProject()
locationLabel("Location"),
descriptionLabel("Description and notes"),
createButton("Create")
set_title("New Project");
add(grid);
//gtk_grid_set_column_spacing(GTK_GRID(grid), 5);
//gtk_grid_set_row_spacing(GTK_GRID(grid), 5);
grid.add(locationLabel);
grid.add(locationEntry);
grid.attach_next_to(descriptionLabel, locationLabel, Gtk::POS_BOTTOM, 1, 1);
grid.attach_next_to(descriptionEntry, locationEntry, Gtk::POS_BOTTOM, 1, 1);
grid.attach_next_to(createButton, descriptionLabel, Gtk::POS_BOTTOM, 2, 1);
//locationEntry.show();
createButton.signal_clicked().connect(sigc::mem_fun(*this,
&NewProject::CreateProject));
show_all_children();
show();
NewProject::~NewProject(){
void NewProject::CreateProject(){
gProject.location = locationEntry.get_text();
gProject.description = locationEntry.get_text();
//printf(gProject.location.c_str());
//printf(locationEntry.get_text().c_str());
Glib::RefPtr<Gtk::Application> app = get_application();
//std::vector<Window*> windows = app->get_windows();
MainWindow mainWindow;
app->add_window(mainWindow);
//mainWindow.Create(); //Create just calls show() on the window, tried it as a simple double check, didn't work
hide();
And MainWindow is defined like this:
class MainWindow : public Gtk::Window{
private:
Gtk::Button testLabel;
public:
void Create();
MainWindow();
virtual ~MainWindow();
MainWindow::MainWindow(){
printf(gProject.location.c_str());
if(gProject.location.empty()){
printf("EMPTY");
}else{
printf("Notempty");
set_title("asd");
Gtk::Button testButton("TEST");
add(testButton);
testButton.show();
show();
//this->project = project;
//Show the new project window
//Glib::RefPtr<Gtk::Application> app = get_application();
//app->add_window(newProject);
MainWindow::~MainWindow(){
void MainWindow::Create(){
show();
So, why doesn't the window show up? I know the code is executed, because I can see the printf() output in the terminal. Instead of showing the new window, the application just exits "successfully". If I open MainWindow from main, the windows shows up, but opening NewProject from MainWindow doesn't work.
As I said, I'm pretty new to GTK programming, so I am not completely sure about how I should organize the code, so what I've done here might for what I now, be completely wrong, so please guide me in the right direction I will take a look at other gtkmm applications to see how they have done it, but right now I have a very limited network connections, so I will have to wait until I get home in a few days.
Thank you I can post more code if needed, but I don't think there is any more GTK relevant code in the project.
Edit: I kind of solved this case, since I made the NewProject window as a dialoge, so it's fine for now. However, if somebody have a general solution, it would be nice
Last edited by Hakon (2012-06-22 20:53:42)

Similar Messages

  • Books / links on best practices when writing on-line Help

    Hi everyone
    Not sure were to place this topic...
    I have not posted in here for ages...
    I am a RoboHelp user and I am looking for one or several
    books about best practices when writing on-line help. For examples,
    what are the "rules" or "do's" and "don'ts" for CSS, topic linking,
    number of clicks, links within a topic, index building, etc.
    Just wondering if some people on this forum know about some
    good books where all of the rules or do's would be compiled?
    Thanks in advance for any input.
    Regards

    KeepItSimple,Stupid!
    That is, just because there are neat things like drop-down
    text, marquees, and such, doesn't mean you should use them.
    Stick to the basic HTML fonts and colors (use the
    w3schools web site for all
    things HTML and CSS.
    Instead of styles, create your lists by selecting Normal
    paragraphs and formatting with the Bullet and Number toolbar
    buttons.
    Keep your tables as simple as possible (try not to nest them
    and have all sorts of row and column spans, and try to avoid lists
    and figures, if you can). Also, break up very long tables into
    functional groupings with introductory headings.
    Use
    Peter Grainge's web
    site and
    Rick
    Stone's web site for all the best workarounds and diagnostics.
    Good luck,
    Leon

  • Best practice for auto update flex web applications

    Hi all
    is there a best practice for auto update flex web applications, much in the same way AIR applications have an auto update mechanism?
    can you please point me to the right direction?
    cheers
    Yariv

    Hey drkstr
    I'm talking about a more complex mechanism that can handle updates to modules being loaded into the application ect...
    I can always query the server for the verion and prevent loading from cach when a module needs to be updated
    but I was hoping for something easy like the AIR auto update feature

  • A must read best practices when starting out in Designer

    Hi,
    Here is a link to a blog by Vishal Gupta on best practices when developing XFA Forms.
    http://www.adobe.com/devnet/livecycle/articles/best-practices-xfa-forms.html
    Please go read it now; it is excellent :-)
    Niall

    I followed below two links. I think it should be the same even though the links are 2008 R2 migration steps.
    http://kpytko.pl/active-directory-domain-services/adding-first-windows-server-2008-r2-domain-controller-within-windows-2003-network/
    http://blog.zwiegnet.com/windows-server/migrate-server-2003-to-2008r2-active-directory-and-fsmo-roles/
    Hope this help!

  • Best practice to create multi tier (atleast 3 level) table

    What is the best practice to create multi tier (minimum 3 levels) of table?. Could any one provide a sample structure?.
    Thanks.

    Can u b more specific as to what you are trying to do. What u mean by 3 level table?

  • Best practice when using Tangosol with an app server

    Hi,
    I'm wondering what is the best practice when using Tangosol with an app server (Websphere 6.1 in this case). I've been able to set it up using the resource adapter, tried using distributed transactions and it appears to work as expected - I've also been able to see cache data from another app server instance.
    However, it appears that cache data vanishes after a while. I've not yet been able to put my finger on when, but garbage collection is a possibility I've come to suspect.
    Data in the cache survives the removal of the EJB, but somewhere later down the line it appear to vanish. I'm not aware of any expiry settings for the cache that would explain this (to the best of my understanding the default is "no expiry"), so GC came to mind. Would this be the explanation?
    If that would be the explanation, what would be a better way to keep the cache from being subject to GC - to have a "startup class" in the app server that holds on to the cache object, or would there be other ways? Currently the EJB calls getCacheAdapter, so I guess Bad Things may happen when the EJB is removed...
    Best regards,
    /Per

    Hi Gene,
    I found the configuration file embedded in coherence.jar. Am I supposed to replace it and re-package coherence.jar?
    If I put it elsewhere (in the "classpath") - is there a way I can be sure that it has been found by Coherence (like a message in the standard output stream)? My experience with Websphere is that "classpath" is a rather ...vague concept, we use the J2CA adapter which most probably has a different class loader than the EAR that contains the EJB, and I would rather avoid to do a lot of trial/error corrections to a file just to find that it's not actually been used.
    Anyway, at this stage my tests are still focused on distributed transactions/2PC/commit/rollback/recovery, and we're nowhere near 10,000 objects. As a matter of fact, we haven't had more than 1024 objects in these app servers. In the typical scenario where I've seen objects "fade away", there has been only one or two objects in the test data. And they both disappear...
    Still confused,
    /Per

  • Best practices when carry forward for audit adjustments

    Dear experts,
    I would like to know if someone can share his best practices when performing carry forward for audit adjustments.
    We are actually doing legal consolidation for one customer and we are facing one issue.
    The accounting team needs to pass audit adjustments around April-May for last year.
    So from January to April / May, the opening balance must be based on December closing of prior year.
    Then from May / June to December, the opening balance must be based on Audit closing of prior year.
    We originally planned to create two members for December period, XXXX.DEC and XXXX.AUD
    Once the accountants would know their audit closing balance, they would have to input it on the XXXX.AUD period and a business rule could compute the difference between the closing of AUD and DEC periods and store the result on an opening flow.
    The opening flow hierarchy would be as follow:
    F_OPETOT (Opening balance Total)
        F_OPE (Opening balance from December)
        F_OPEAUD (Opening balance from the difference between closing balance of Audit and December periods)
    Now, assume that we are in October, but for any reason, the accountant run a carry forward for February, he is going to impact the opening balance because at this time (October), we have the audit adjustments.
    How to avoid such a thing? What are the best practices in this case?
    I guess it is something that you may have encounter if you did a consolidation project.
    Any help will be greatly appreciated.
    Thanks
    Antoine Epinette

    Cookman and I have been arguing about this since the paleozoic era. Here's my logic for capturing everything.
    Less wear and tear on the tape and the deck.
    You've got everything on the system. Can't tell you how many times a client has said "I know that there was a better take." The only way to disabuse them of this notion is to look at every take. if it's not on the system, you've got to spend more time finding the tape, and adding "wear and tear on the tape and the deck." And then there's the moment where you need to replace the audio for one word from another take. You can quickly check all the other takes (particularly if you've done a thorough job logging the material - see below)_.
    Once it's on the system, you still need to log and learn the material. You can scan thru material much faster once it's captured. Jumping around the material is much easier.
    There's no question that logging the material before you capture makes you learn the material in a more thorough way, but with enough selfdiscipline, you can learn the material as thoroughly once it's been captured.

  • Best practice when modifying SAP Standard Development Component

    Hello Experts,
    What is best practice when modifying SAP Standard Development Component (Java Web Dynpro)? Iu2019m looking for the best method to do modifications to SAP Standard DC so that my changes will be kept (or need low maintenance) after a new service package (or EHP) is applied.
    Thanks,
    Kevin

    Hi,
      'How to use Busiess Packages in Enterprise Portal 6.0' is available in this link.
    http://help.sap.com/bp_epv260/EP_EN/documentation/How-to_Guides/misc/Using_Business_Packages.pdf
    Check out for the best practices.
    Regards,
    Harini S

  • Best practices when making service requests

    Best practices when making service requests
    We've been working on moving our old services that were built with an different service request tool into RequestCenter and were wondering if anyone had any thoughts about best standards or practices for the new forms that they would be willing to share.  For example, one such standard might be that the customer - initiator information will always be displayed at the top of the request.
    Are there any other standardizations you could share that help lend consistency and provide improved readability for request forms?  Maybe someone has a design framework guide they would be willing to share?
    Thanks!
    Tim

    Thanks for the comments and the book suggestion.
    We've been placing the customer information at the top because wanted the customer to review the information before subbmitng the form.  Our LDAP data is somewhat spotty and we want to make sure we have the right information when the form is submitted but I can see the advantages to placing it at the bottom as well.  I'll have to think that over more.
    Does anyone find tha certain fields work better than others?  For example, we've not had much

  • What do you find to be best practice when it comes to writing AS code to manage a big app ?

    Right now I am considering 3 options:
    1) I write all the code in a root component that extends group for example like this:
    <s:Application>
         <s:AppGroup>
                   <s:List />
         </s:AppGroup>
    </s:Application>
    So in it I will write the code to manage the list. Ok but Imagine now I have 10 views inside that AppGroup each having a list which needs to be managed. So here comes my option 2.
    2) I write code in the AppGroup component to manage what's on it's level and for new level (view for example) I create another component like ViewGroup1, ViewGroup2 etc which extends group or something else and I write code in it to manage what's inside of it. This looks like this:
    <s:Application>
         <s:AppGroup>
              <s:ViewGroup1>
                   <s:List />
              </s:ViewGroup1>
              <s:ViewGroup2>
                   <s:List />
              </s:ViewGroup2>
         </s:AppGroup>
    </s:Application>
    So this time the code to manage the views will be in AppGroup and the code for managing the Lists will be in the ViewGroup1/2 component.
    3) of course sometimes mixed architecture if for example the ViewGroup1 is very simple and doesn't have list but a label or something like that the code could be written in the AppGroup.
    What do you think of this code structure? Is my logic good or there's something else considered a best practice at the moment ? Thanks!

    Thank you all for the thoughts. Could we please stick to flex only for now...
    Currently I have a project where I see this structure:
    <Application creationComplete="init();">
         <fx:Script source="MainApp.as" /> - all initialization code is here
         <components /> - many components
    </Application>
    In the creation complete of the Application which is in MainApp.as, dataProviders are set and a controller class is initiated to which the Application is passed as Object and everything is manipulated from that controller. As you mentioned I guess you can always create additional controllers and pass them the Application or some other components from which they could start controlling so to speak.
    I am not sure if this structure is good or not, I started comparing it with mine and I ended up here...
    What I see at this point compared to mine is that:
    - in the included MainApp.as in Application I have question marks when i type something like "stage" in a function, I needs me to type "this.stage", which I don't like. To me it looks like including is bad and maybe everything should have started with creationComplete in the Application mxml with importing and initiating the controller with passing him the Application right away. Is that correct?
    - in the example given above, after MainApp initiates the controller by passing him the Application, the controller looses all of the nice code hints since now the Application is an object... maybe it's wrong for it to be object ? Should it be something else?
    Compared to my approach when I separate my logic into AS Group which is then extended as MXML Group. All I have to do is declare the instances in AS which I have as IDs in MXML and voila... I can control them and write their logic with all the nice code hints present.
    So basicly at this point you say instead of extending Group in AS every time I want to separate logic, write a controller right ?
    Here is what I summarized for now:
    1) Create a RootController class
    2) Initiate it in the creation complete of the Application passing the Application (as what type - object or something else?)
    3) manage all logic in that controller
    4) if parts of the application are too complex they can be separated into additional controllers.
    5) the RootController can initiate SubControllers which can initiate SubSubControllers
    6) to all controllers a component must be passed as a starting point for the logic
    Is this correct? If yes, what about the code hinting compared to my approach?
    Would be very nice if someone of you could make a very very very simple app with the model you are talking about, or if you have an article you took it from share the link! Thanks!

  • Best practices for a multi-language application

    Hi,
    I'm planning to develop an application to work in two different countries and I'm hopping to get some feedback from this community on the best practices to follow when building the application. The application will run in two different languages (English and French) and in two different timezones;
    My doubts:
    - Wich type format is more appropriated to my table date fields?
    - I will build the application on english language. Since APEX has the french language for the admin frontend, how can I install it and can I reuse the translation to my applications? The interactive reports region are somewhere translated into french, how can I access that translation and use it in my application?
    Thank you

    Hello Cao,
    >> The application will run in two different languages (English and French) and in two different timezones …. It would be very helpful if I could access at least the translation of the IRR regions.
    As you mentioned, French is one of the native supported languages by the Application Builder. As such, all the internal APEX engine messages (including those for IR) were translated to French. In order to enjoy it you need to upload the French language into your Application Builder. The following shows you how to do that:
    http://download.oracle.com/docs/cd/E23903_01/doc/doc.41/e21673/otn_install.htm#BEHJICEB
    In your case, the relevant directory is *…/apex/builder/fr/ *. Please pay attention to the need to set properly the NLS_LANG parameter.
    >> Wich type format is more appropriated to my table date fields?
    I’m not sure exactly what you mean by that. Date fields are saved in the database format free and it’s up to you to determine how to display them, usually by using the to_char() function.
    As you mentioned that you are going to work with two different time zones, it’s possible that the date format for these two zones are different. In this case, you can use the APEX Globalization Application Date Time Format item. As the help for this item shows, you can use a substitution string as the item value, and you can set the value of the substitution string according to the current language and its corresponding date format.
    You should also set the Automatic Time Zone field to yes. It will make your life a bit easier.
    Regards,
    Arie.
    &diams; Please remember to mark appropriate posts as correct/helpful. For the long run, it will benefit us all.
    &diams; Author of Oracle Application Express 3.2 – The Essentials and More

  • Best practice for managing a Windows 7 deployment with both 32-bit and 64-bit?

    What is the best practice for creating and organizing deployment shares in MDT for a Windows 7 deployment that has mostly 32-bit computers, but a few 64-bit computers as well? Is it better to create a single deployment share for Windows 7 and include both
    versions, or is it better to create two separate deployment shares? And what about 32-bit and 64-bit versions of applications?
    I'm currently leaning towards creating two separate deployment shares, just so that I don't have to keep typing (x86) and (x64) for every application I import, as well as making it easier when choosing applications in the Lite Touch installation. But I know
    each deployment share has the option to create both an x86 and x64 boot image, so that's why I am confused. 

    Supporting two task sequences is way easier than supporting two shares. Two shares means two boot media, or maintaining a method of directing the user to one or the other. Everything needs to be imported or configured twice. Not to mention doubling storage
    space. MDT is designed to have multiple task sequences, why wouldn't you use them?
    Supporting multiple task sequences can be a pain, but not bad once you get a system. Supporting app installs intelligently is a large part of that. We have one folder per app install, with a wrapper vbscript that handles OS detection. If there are separate
    binaries, they are placed in x86 and x64 subfolders. Everything runs from one folder via the same command, "cscript install.vbs". So, import once, assign once, and forget it. Its the same install package we use for Altiris, and we'll be using a Powershell
    version of it when we fully migrate to SCCM.
    Others handle x86 and x64 apps separately, and use the MDT app details to select what platform the app is meant for. I've done that, but we have a template for the vbscript wrapper and its a standard process, I believe its easier. YMMV.
    Once you get your apps into MDT, create bundles. Core build bundle, core deploy bundle, Laptop deploy bundle, etcetera. Now you don't have to assign twenty apps to both task sequences, just one bundle. When you replace one app in the bundle, all TS'es are
    updated automatically. Its kind of the same mentality as active directory. Users, groups and resources = apps, bundles and task sequences.
    If you have separate build and deploy shares in your lab, great. If not, separate your apps into build and deploy folders in your lab MDT share. Use a selection profile to upload only your deploy side to production. In fact I separate everything (except
    drivers) into Build and deploy folders on my lab server. Don't mix build and deploy, and don't mix Lab/QA and production. I also keep a "Retired" folder. When I replace an app, TS, OS, etcetera, I move it to the retired folder and append "RETIRED - " to the
    front of it  so I can instantly spot it if it happens to show up somewhere it shouldn't.
    To me, the biggest "weakness" of MDT is its flexibility. There's literally a dozen different ways to do everything, and there's no fences to keep you on the path. If you don't create some sort of organization for yourself, its very easy to get lost as things
    get complicated. Tossing everything into one giant bucket will have you pulling your hair out.

  • Best Practices when replacing 2003 server R2 with a new domainname and server 2012 r2 on same lan network

    I have a small office (10 computers with five users) that have a Windows 2003 server that has a corrupted AD. Their 2003 server R2 is essentially a file server and provides authentication.  They purchased a new Dell 2012 R2 server.  
    It seems easier to me to just create a new domain (using their public domain name).  
    But I need as little office downtime. as possible . Therefore I would like to promote this server to its new domain on the same lan as the current domain server.  I plan to manually replicate the users and folder permissions.  Once done, I plan to
    remove the old server from the network and join the office computers to the new domain.  
    They also they are also running a legacy application that will require some tweaking by another tech. I have been hoping to prep the new domain prior to new legacy tech arriving.  That is why I would like both domain to co-exist temporarily. I have read
    that the major issues involved in this kind of temporary configuration will then be related to setting up dns.  They are using the firewall to provide dhcp.
    Are there any best practices documents for this situation?
    Or is there a better or simpler strategy?
    Gary Metz

    I followed below two links. I think it should be the same even though the links are 2008 R2 migration steps.
    http://kpytko.pl/active-directory-domain-services/adding-first-windows-server-2008-r2-domain-controller-within-windows-2003-network/
    http://blog.zwiegnet.com/windows-server/migrate-server-2003-to-2008r2-active-directory-and-fsmo-roles/
    Hope this help!

  • Best-practice on versioning a soa suite-application

    Hi everyone,
    I recently organised a seminar for customers concerning the Soa Suite Stack and one of the interesting questions asked that day was a versioning-question.
    Let's say we've build a bpel/esb application interacting with different external and internal webservices and we've deployed this application to our production environment and we need to change an internal web service.
    How can we add versioning to this heterogenous system in a consistent way? I know you can tell esb which version of the bpel process it needs to use, but what about the custom and external webservices that we've integrated with?
    My 2 cents: You need to add a versioning-tag to you custom web services that you need to manage yourself, and use this versioning tag in the services your integrating with.
    Could somebody point me out what best practice is, or what Oracle's development team is working out regarding versioning systems for SOA-applications?

    Marc,
    Are you saying versioning isn't supported in ESB now? I thought that ESB already uses the versioning tag from bpel when you're integrating bpel and esb?
    During the development of my demo I've seen that the version-tag was used when invoking the bpel process through a soa service.

  • Best Practice to use a single root Application Module?

    I was reading in another thread that it may be a good idea to have all application modules nested within a single root application module (AM) so that there is only 1 session maintained for the root AM, versus an individual session for each AM. Is this a best practice? If yes, should the root AM be a skeleton AM (minimal customer service methods), or, should you select the most heavily used AM and nest the other AM's underneath of it?
    In my case, I currenlty have 2 AM's (and will have 3 AM's in the future) each representing a different set of use cases withn the application (i.e., one supports users searches / shopping cart-like functionality, and the second supports an enrollment process.) It could be the case that a user only accesses pages on the web site to do searches (first AM), or only to do enrollment (2nd AM), or, they may access pages of the site that access both AM's. Right now I have 2 separate AM's that are not nested. Should I nest the AM's and define a root AM?
    thanks

    Hi javaX
    The main physical effect of having 2 separate AMs is that they have their own transactions with the database, and presumably sit in the application module pool as their own instances consuming connections from the connection pool. Alternatively a single root AM with 2 nested AMs share a single transaction through the root AM; only the root AM controls the transaction in this scenario.
    As such it's a question of do you need separate transactions or will one suffice?
    How you group your EOs/VOs etc within the AMs is up to you, but usually falls into logical groups such as you have done. If a single transaction is fine, instead of creating multiple AMs, you could instead just create logical package structures instead. Neither method is right or wrong, they're just different ways of structuring your application.
    When you create a nested AM structure, within your ViewController project in the Data Control Palette you'll actually see 3 data controls mapped to each AM. In addition expanding the root AM data control, you'll see the nested AMs again. Create a dummy project with a nested AM structure and you'll see what I mean.
    If you base your page definitions on anything from the root AM and it's children in the Data Control Palette, this will work on the root AM's transaction.
    If you base your page definitions on something from one of the other AM data controls that isn't inside the main root AM in the Data Control Palette, instead of using the root AM's transaction, the separate child AM will be treated as root AM and will have its own transaction.
    The thing to care of when developing web pages is to consistently use the AM and it's nested AMs, or the child AMs directly with their separate transactions, otherwise it might cause a bit of a nightmare debugging situation later on when the same application is locking and blocking on the same records from 2 separate AM transactions.
    Hope this helps.
    CM.

Maybe you are looking for

  • List of Issues in Scheduling agreement ??

    Hii experts Cam somebody explain me about the crictical issue in scheduling agreements in MM . What kind of issues will occur in SAP SA scenario. Can somebody share their exp on this ... Thanks

  • IPhone will not sync when Windows Vista laptop is offline

    Hi there. My iPhone 3GS syncs OK when my Laptop has a wireless connection to the internet but if it is offline, itunes will not recognise my iPhone. It shows up in 'My Computer' as a Mobile device. I have deleted and reinstalled iTunes and quickTime

  • Picture too Large for Screen

    Is there a way to adjust the cable box so that the picture adjusted properly to fit the screen?  Currently I have a Phillips 30 inch Widescreen HD tv and certain channels dont fit the screen.  (ESPN News QVC Fox Business) .   The Tv does not have a s

  • ITunes always busy in com.apple.MediaLibraryService

    Hi, I use Mac OS X 10.10.1 and iTunes 12.0.1.26. iTunes is almost always busy in com.apple.MediaLibraryService. com.apple.MediaLibraryService 198,0 15:57,85 4 1 72959 joswig 64-Bit 0 Byte 0 Byte 0 Byte 0 Byte Nein 0 Byte 0 Byte 0 0 0 Byte 0 Byte 0 By

  • Windows 8 Windows Update fails with error 80244FFF

    Windows 8 Windows Update fails with error 80244FFF