public IList<AbstractComponentFunctorApplication> list(){
		  IList<AbstractComponentFunctorApplication> list = new List<AbstractComponentFunctorApplication>();
		  AbstractComponentFunctorApplication acfa = null;
		  IDbConnection dbcon = Connector.DBcon;
	      IDbCommand dbcmd = dbcon.CreateCommand();
	      string sql =
	           "SELECT id_abstract, id_functor_app, id_functor_app_next " +
	           "FROM abstractcomponentfunctorapplication ";
	            
	       dbcmd.CommandText = sql;
	       IDataReader reader = dbcmd.ExecuteReader();
	       while(reader.Read()) {
	       		acfa = new AbstractComponentFunctorApplication();
	       		acfa.Id_functor_app = (int)reader["id_functor_app"];
	       		acfa.Id_abstract = (int)reader["id_abstract"];
       		    acfa.Id_functor_app_next = (int)reader["id_functor_app_next"];
	       		list.Add(acfa);
                if (!cache_acfa.ContainsKey(acfa.Id_functor_app)) cache_acfa.Add(acfa.Id_functor_app, acfa);
	       }//while
	       // clean up
	       reader.Close();
	       reader = null;
	       dbcmd.Dispose();
	       dbcmd = null;
	       return list;
	}
    public AbstractComponentFunctorApplication retrieve_next(int id_functor_app_next)
    {
        AbstractComponentFunctorApplication acfa = null;

	   IDbConnection dbcon = Connector.DBcon;
       IDbCommand dbcmd = dbcon.CreateCommand();
      string sql =
           "SELECT id_abstract, id_functor_app, id_functor_app_next " +
           "FROM abstractcomponentfunctorapplication " +
           "WHERE id_functor_app_next="+id_functor_app_next;
       dbcmd.CommandText = sql;
       IDataReader reader = dbcmd.ExecuteReader();
       while(reader.Read()) {
       		acfa = new AbstractComponentFunctorApplication();
       		acfa.Id_functor_app = (int)reader["id_functor_app"];
       		acfa.Id_abstract = (int)reader["id_abstract"];
       		acfa.Id_functor_app_next = (int)reader["id_functor_app_next"];
       }//while
       // clean up
       reader.Close();
       reader = null;
       dbcmd.Dispose();
       dbcmd = null;
			
//	   if (acfa==null) 
//	   {
//	  	  Console.WriteLine("AbstractComponentFunctorApplicationDAO.cs: ACFA \"NEXT\" NOT FOUND "+ id_functor_app_next);
//	   }
			
       return acfa;
	}
	public IList<AbstractComponentFunctorApplication> listByIdAbstract(int id_abstract){
		  
          IList<AbstractComponentFunctorApplication> list = null;
          if (cache_acfa_list_byabstract.TryGetValue(id_abstract, out list)) return list;
          list = new List<AbstractComponentFunctorApplication>();
          cache_acfa_list_byabstract.Add(id_abstract, list);

		  AbstractComponentFunctorApplication acfa = null;
		  IDbConnection dbcon = Connector.DBcon;
	      IDbCommand dbcmd = dbcon.CreateCommand();
	      string sql =
	           "SELECT acfa.id_abstract, acfa.id_functor_app, acfa.id_functor_app_next " +
	           "FROM component as c, abstractcomponentfunctorapplication as acfa " + 
			   "WHERE c.id_functor_app = acfa.id_functor_app AND " + 
					 "acfa.id_abstract = " + id_abstract;
	            
	       dbcmd.CommandText = sql;
	       IDataReader reader = dbcmd.ExecuteReader();
	       while(reader.Read()) {
	       		acfa = new AbstractComponentFunctorApplication();
	       		acfa.Id_functor_app = (int)reader["id_functor_app"];
	       		acfa.Id_abstract = (int)reader["id_abstract"];
       		    acfa.Id_functor_app_next = (int)reader["id_functor_app_next"];
	       		list.Add(acfa);
                if (!cache_acfa.ContainsKey(acfa.Id_functor_app)) cache_acfa.Add(acfa.Id_functor_app, acfa);
	       }//while
	       // clean up
	       reader.Close();
	       reader = null;
	       dbcmd.Dispose();
	       dbcmd = null;
	       return list;
	}
		public int insert(AbstractComponentFunctorApplication ac, int facet_index)
		{
			IDbConnection dbcon = Connector.DBcon;
			IDbCommand dbcmd = dbcon.CreateCommand();
			String sql =
				"INSERT INTO abstractcomponentfunctorapplication (id_abstract, id_functor_app_next, facet_index)" +
				" VALUES (" + ac.Id_abstract + "," +  ac.Id_functor_app_next + "," + facet_index + "); " + 
				"SELECT max(id_functor_app) as id_functor_app from abstractcomponentfunctorapplication where facet_index="+facet_index;

			Console.WriteLine("AbstractComponentFunctorApplication.cs: TRY INSERT: " + sql);

			dbcmd.CommandText = sql;
			IDataReader reader = dbcmd.ExecuteReader();
			while(reader.Read()) {
				ac.Id_functor_app = (int)reader["id_functor_app"];
			}

			// clean up
			reader.Close();
			reader = null;
			dbcmd.Dispose();
			dbcmd = null;


			if (cache_acfa.ContainsKey(ac.Id_functor_app))
			{
				cache_acfa.Remove(ac.Id_functor_app);
				cache_acfa.Add(ac.Id_functor_app, ac);
			}

			return ac.Id_functor_app;
		}
	public void updateIdFunctorAppNext(AbstractComponentFunctorApplication acfa, int id_functor_app_next) 
	{
        String sql = "UPDATE abstractcomponentfunctorapplication SET id_functor_app_next = " + id_functor_app_next + " " +
                     " WHERE id_functor_app=" + acfa.Id_functor_app + "";

        Connector.performSQLUpdate(sql);
	}
예제 #6
0
        private void collectFV(AbstractComponentFunctorApplication acfa,
                               IDictionary <string, AbstractComponentFunctorApplication> pars,
                               IDictionary <string, AbstractComponentFunctorApplication> apars)
        {
            //SupplyParameterDAO spdao = new SupplyParameterDAO();
            IList <SupplyParameter> sps = br.ufc.pargo.hpe.backend.DGAC.BackEnd.spdao.list(acfa.Id_functor_app);

            foreach (SupplyParameter sp in sps)
            {
                if (sp is SupplyParameterComponent)
                {
                    SupplyParameterComponent sp_ = (SupplyParameterComponent)sp;
                    // AbstractComponentFunctorApplicationDAO acfadao = new AbstractComponentFunctorApplicationDAO();
                    AbstractComponentFunctorApplication acfaPar = br.ufc.pargo.hpe.backend.DGAC.BackEnd.acfadao.retrieve(sp_.Id_functor_app_actual);
                    collectFV(acfaPar, pars, apars);
                }
                else if (sp is SupplyParameterParameter)
                {
                    SupplyParameterParameter            sp_     = (SupplyParameterParameter)sp;
                    AbstractComponentFunctorApplication acfaPar = null;
                    pars.TryGetValue("#" + sp_.Id_functor_app + sp_.Id_parameter, out acfaPar);
                    if (acfaPar == null)
                    {
                        pars.TryGetValue(sp_.Id_argument, out acfaPar);
                    }
                    Console.WriteLine("collectFV : id_functor_app=" + acfa.Id_functor_app + ", id_abstract=" + acfa.Id_abstract + ", " + "#" + sp_.Id_functor_app + sp_.Id_parameter + ", " + ", " + sp_.Id_argument + (acfaPar == null));
                    apars.Add("#" + sp_.Id_functor_app + sp_.Id_parameter, acfaPar);
                }
            }
        }
    public AbstractComponentFunctorApplication retrieve(int id_functor_app)
    {
        AbstractComponentFunctorApplication acfa = null;
        if (cache_acfa.TryGetValue(id_functor_app, out acfa)) return acfa;        

	   IDbConnection dbcon = Connector.DBcon;
       IDbCommand dbcmd = dbcon.CreateCommand();
      string sql =
           "SELECT id_abstract, id_functor_app, id_functor_app_next " +
           "FROM abstractcomponentfunctorapplication " +
           "WHERE id_functor_app="+id_functor_app;
			Console.WriteLine ("AbstractComponentFunctorApplicationDAO - retrieve: " + sql);
       dbcmd.CommandText = sql;
       IDataReader reader = dbcmd.ExecuteReader();
       while(reader.Read()) {
       		acfa = new AbstractComponentFunctorApplication();
       		acfa.Id_functor_app = (int)reader["id_functor_app"];
       		acfa.Id_abstract = (int)reader["id_abstract"];
       		acfa.Id_functor_app_next = (int)reader["id_functor_app_next"];
            cache_acfa.Add(acfa.Id_functor_app, acfa);
       }//while
       // clean up
       reader.Close();
       reader = null;
       dbcmd.Dispose();
       dbcmd = null;
			
	   if (acfa==null) 
	   {
	  	  Console.WriteLine("AbstractComponentFunctorApplicationDAO.cs: ACFA NOT FOUND "+ id_functor_app);
	   }
			
       return acfa;
	}
예제 #8
0
    }//retrieve


    public IList<InnerComponent> list(int id_abstract_start)
    {
	
	   IDictionary<string,InnerComponent> list = new Dictionary<string,InnerComponent>();
			
	   int id_abstract = id_abstract_start;
		
	   while (id_abstract > 0) 
	   {			
		   IDbConnection dbcon = Connector.DBcon;
	       IDbCommand dbcmd = dbcon.CreateCommand();
	       string sql =
	           "SELECT id_abstract_owner, id_inner, id_functor_app, id_abstract_inner, parameter_top, transitive, public, multiple " +
	           "FROM innercomponent " +
	           "WHERE id_abstract_owner="+id_abstract + " " +
			   "ORDER BY transitive";
	       dbcmd.CommandText = sql;
	       IDataReader reader = dbcmd.ExecuteReader();
	       while(reader.Read()) {
	       		InnerComponent ic = new InnerComponent();
	       		ic.Id_abstract_owner = (int)reader["id_abstract_owner"];
	       		ic.Id_inner = (string)reader["id_inner"];
	       		ic.Id_functor_app = (int)reader["id_functor_app"];
	       		ic.Id_abstract_inner = (int)reader["id_abstract_inner"];
	            ic.Parameter_top = (string)reader["parameter_top"];
	            ic.Transitive = ((int)reader["transitive"]) == 0 ? false : true;
	            ic.IsPublic = ((int)reader["public"]) == 0 ? false : true;
				ic.Multiple = ((int)reader["multiple"]) == 0 ? false : true;
				if (!list.ContainsKey (ic.Id_inner))
					list.Add (ic.Id_inner, ic);
				else
					Console.Error.WriteLine ("InnerComponentDAT-list: inner component {0} already exists", ic.Id_inner);
	       }//while
	       // clean up
	       reader.Close();
	       reader = null;
	       dbcmd.Dispose();
	       dbcmd = null;
				
           AbstractComponentFunctor acf = br.ufc.pargo.hpe.backend.DGAC.BackEnd.acfdao.retrieve(id_abstract);
		   if (acf.Id_functor_app_supertype > 0)
		   {
			   AbstractComponentFunctorApplication acfa = br.ufc.pargo.hpe.backend.DGAC.BackEnd.acfadao.retrieve(acf.Id_functor_app_supertype);
			   id_abstract = acfa.Id_abstract;
		   }
		   else 
			   id_abstract = -1;			
	   }

	   IList<InnerComponent> list_return = new List<InnerComponent> (list.Values);

	   return list_return;
       
	}//list
예제 #9
0
		internal IList<InnerComponentExposed> retrieveContainerList(int id_abstract_start, string id_inner_owner, string id_inner)
		{
			int id_abstract = id_abstract_start;
			IList<InnerComponentExposed> iceList = new List<InnerComponentExposed>();
            InnerComponentExposed ice = null;

			while (id_abstract > 0)
			{
				IDbConnection dbcon = Connector.DBcon;
				IDbCommand dbcmd = dbcon.CreateCommand();
				string sql =
					"SELECT id_abstract, id_inner_rename, id_inner_owner, id_inner " +
					"FROM innercomponentexposed " +
					"WHERE id_abstract=" + id_abstract + " AND " +
						  "id_inner like '" + id_inner + "' AND " +
						  "id_inner_owner like '" + id_inner_owner + "'";
				Console.WriteLine("retrieveContainer: " + sql);
				dbcmd.CommandText = sql;
				IDataReader reader = dbcmd.ExecuteReader();
				while (reader.Read())
				{
					ice = new InnerComponentExposed();
					ice.Id_abstract = (int)reader["id_abstract"];
					ice.Id_inner_rename = (string)reader["id_inner_rename"];
					ice.Id_inner_owner = (string)reader["id_inner_owner"];
					ice.Id_inner = (string)reader["id_inner"];
                    iceList.Add(ice);
				}//while
				 // clean up
				reader.Close();
				reader = null;
				dbcmd.Dispose();
				dbcmd = null;

				if (ice == null)
				{
					AbstractComponentFunctor acf = br.ufc.pargo.hpe.backend.DGAC.BackEnd.acfdao.retrieve(id_abstract);
					if (acf.Id_functor_app_supertype > 0)
					{
						AbstractComponentFunctorApplication acfa = br.ufc.pargo.hpe.backend.DGAC.BackEnd.acfadao.retrieve(acf.Id_functor_app_supertype);
						id_abstract = acfa.Id_abstract;
					}
					else
						id_abstract = -1;
				}
				else
					id_abstract = -1;
			}

			return iceList;
		}
        private static bool recMatchParameters(TreeNode node, AbstractComponentFunctorApplication acfa)
        {
            AbstractComponentFunctorApplication acfaSon = null;

            IList <SupplyParameterComponent> spList = br.ufc.pargo.hpe.backend.DGAC.BackEnd.spcdao.list(acfa.Id_functor_app);

            IDictionary <string, int> ttt = new Dictionary <string, int>();

            foreach (SupplyParameterComponent sp_ in spList)
            {
                SupplyParameterComponent sp = (SupplyParameterComponent)sp_;
                ttt.Add(sp.Id_parameter, sp.Id_functor_app_actual);
            }

            foreach (TreeNode nodeSon in node.Children)
            {
                string parameter_id          = nodeSon.Parameter_id;
                int    id_functor_app_actual = -1;
                bool   found = false;
                foreach (string parid in nodeSon.getParameterIdSyns())
                {
                    if (ttt.ContainsKey(parid))
                    {
                        found = true;
                        ttt.TryGetValue(parid, out id_functor_app_actual); // TODO
                        acfaSon = br.ufc.pargo.hpe.backend.DGAC.BackEnd.acfadao.retrieve(id_functor_app_actual);
                        if (acfaSon.Id_abstract != nodeSon.Functor_app.Id_abstract)
                        {
                            // Console.WriteLine("FAIL 1! ");
                            return(false);
                        }
                        //Console.WriteLine("MATCH! ");
                    }
                }

                if (found)
                {
                    if (!recMatchParameters(nodeSon, acfaSon))
                    {
                        return(false);
                    }
                }
            }

            return(true);
        }
예제 #11
0
        private InnerComponent findInnerComponentOwnerOfSlice(int Id_abstract, string id_inner)
        {
            int            Id_abstract_traverse = Id_abstract;
            InnerComponent ic = null;

            while (ic == null && Id_abstract_traverse != 0)
            {
                ic = br.ufc.pargo.hpe.backend.DGAC.BackEnd.icdao.retrieve(Id_abstract_traverse, id_inner);
                if (ic == null)
                {
                    AbstractComponentFunctor            cTraverse = br.ufc.pargo.hpe.backend.DGAC.BackEnd.acfdao.retrieve(Id_abstract_traverse);
                    AbstractComponentFunctorApplication cSuperApp = br.ufc.pargo.hpe.backend.DGAC.BackEnd.acfadao.retrieve(cTraverse.Id_functor_app_supertype);
                    Id_abstract_traverse = cSuperApp.Id_abstract;
                }
            }
            return(ic);
        }
예제 #12
0
        private static IList <AbstractComponentFunctorApplication> buildGeneralizationSteps(AbstractComponentFunctorApplication acfActual, AbstractComponentFunctorApplication acfaTop)
        {
            AbstractComponentFunctorApplication         id_abstract_step = acfActual;
            AbstractComponentFunctorApplication         id_abstract_top  = acfaTop;
            IList <AbstractComponentFunctorApplication> gs = new List <AbstractComponentFunctorApplication>();
            AbstractComponentFunctor acf;

            while (id_abstract_step.Id_abstract != id_abstract_top.Id_abstract)
            {
                gs.Add(id_abstract_step);
                acf = br.ufc.pargo.hpe.backend.DGAC.BackEnd.acfdao.retrieve(id_abstract_step.Id_abstract);
                id_abstract_step = br.ufc.pargo.hpe.backend.DGAC.BackEnd.acfadao.retrieve(acf.Id_functor_app_supertype);
            }

            gs.Add(id_abstract_step);

            return(gs);
        }
예제 #13
0
        //receives id_concrete and id inner wich belongs for that inner
        //returns a impl of the inner
        //return -1 if the impl doesnt exist


        public static Component resolveImpl(AbstractComponentFunctorApplication acfaRef, IDictionary <string, int> actualParameters, IDictionary <string, int> actualParametersTop)
        {
            //Console.WriteLine("RESOLVE IMPL - id_functor_app=" + acfaRef.Id_functor_app + " - id_abstract=" + acfaRef.Id_abstract);

            // get inner component application
            if (acfaRef != null)
            {
                IDictionary <string, int> actualParameters_new = new Dictionary <string, int>();
                IDictionary <string, int> actualParameters_old = new Dictionary <string, int>(actualParametersTop);
                foreach (KeyValuePair <string, int> pair in actualParameters)
                {
                    if (!actualParameters_old.ContainsKey(pair.Key))
                    {
                        actualParameters_old.Add(pair);
                    }
                }

                DGAC.BackEnd.determineArguments(actualParameters_old, acfaRef.Id_functor_app, out actualParameters_new);

                foreach (KeyValuePair <string, int> pair in actualParameters_new)
                {
                    acfaRef.addParameter(pair.Key, pair.Value);
                }
            }

            // AT THIS POINT, the FUNCTOR OF THE INNER COMPONENT, WITH PARAMETERS SUPPLIED,
            //    HAVE BEEN DISCOVERED. Now, it is necessary to apply the procedure findHashComponent
            //    descrito no artigo.

            Console.WriteLine("resolveImpl ENTER findHashComponent ! " + acfaRef.Id_functor_app);

            Component componentRef = Resolution.findHashComponent(actualParametersTop, acfaRef);

            if (componentRef == null)
            {
                Console.WriteLine("componentRef NULL ! id_functor_app = " + acfaRef.Id_functor_app + ", id_abstract = " + acfaRef.Id_abstract);
                return(null);
            }
            else
            {
                Console.WriteLine("resolveImpl OK ! " + componentRef.Library_path);
                return(componentRef);
            }
        }//resolution
        internal Interface retrieveSuper(int id_abstract, string id_interface)
        {
            Console.WriteLine("retrieveSuper - BEGIN 1 " + id_abstract + "/" + id_interface);
            bool loop;
            AbstractComponentFunctor acf = DGAC.BackEnd.acfdao.retrieve(id_abstract);

            IList <Interface> iList = BackEnd.idao.list(id_abstract);

            Console.WriteLine("retrieveSuper - BEGIN 2 " + iList.Count);
            foreach (Interface i in iList)
            {
                IList <Tuple <AbstractComponentFunctor, Interface> > queue = new List <Tuple <AbstractComponentFunctor, Interface> > ();
                queue.Add(new Tuple <AbstractComponentFunctor, Interface> (acf, i));
                while (queue.Count > 0)
                {
                    AbstractComponentFunctor acfCurr = queue[0].Item1;
                    Interface iCurr = queue[0].Item2;
                    queue.RemoveAt(0);
                    Console.WriteLine("retrieveSuper - DEQUEUE - id_abstract=" + acfCurr.Id_abstract + " / id_interface=" + iCurr.Id_interface);
                    if (iCurr.Id_interface.Equals(id_interface))
                    {
                        Console.WriteLine("retrieveSuper: found id_abstract=" + acfCurr.Id_abstract + " / id_interface=" + iCurr.Id_interface);
                        return(i);
                    }
                    else if (loop = acfCurr.Id_functor_app_supertype > 0)
                    {
                        AbstractComponentFunctorApplication acfaSuper = DGAC.BackEnd.acfadao.retrieve(acfCurr.Id_functor_app_supertype);
                        acfCurr = DGAC.BackEnd.acfdao.retrieve(acfaSuper.Id_abstract);
                        string[] id_interface_super_list = Interface.splitIDs(iCurr.Id_interface_super);
                        foreach (string id_interface_super in id_interface_super_list)
                        {
                            Console.WriteLine("retrieveSuper: id_abstract=" + acfCurr.Id_abstract + " / id_interface=" + iCurr.Id_interface);
                            iCurr = DGAC.BackEnd.idao.retrieve(acfaSuper.Id_abstract, id_interface_super);
                            queue.Add(new Tuple <AbstractComponentFunctor, Interface> (acfCurr, iCurr));
                        }
                    }
                }
            }

            Console.WriteLine("retrieveSuper - END NULL");
            return(null);
        }
        public static Component[] findHashComponentAll(AbstractComponentFunctorApplication acfaRef)
        {
            try
            {
                Connector.openConnection();

                Console.WriteLine("FIND HASH COMPONENT ALL: " + acfaRef.Id_functor_app);

                Component[] cAll;

                TreeNode root = GenerateTree.generate(new Dictionary <string, int>(), acfaRef);

                Resolution.sort(root);

                TreeNode tn = root;
                while (tn != null)
                {
                    Trace.Write(tn.Functor_app.Id_abstract + "@" + tn.GetHashCode() + "->");
                    tn = tn.Next;
                }

                writeTreeNode(root);

                Console.WriteLine("AFTER Resolution.sort(root) - ALL");

                cAll = Resolution.tryGeneralizeAll(root, root);

                Console.WriteLine("AFTER Resolution.tryGeneralize(root, root) - ALL");

                return(cAll);        // if c is null, there is not an implementation ....
            }
            catch (Exception e)
            {
                throw e;
            }
            finally
            {
                Connector.closeConnection();
            }
        }
        public static Component findHashComponent(IDictionary <string, int> actualParametersTop, AbstractComponentFunctorApplication acfaRef)
        {
            Console.WriteLine("FIND HASH COMPONENT: " + acfaRef.Id_functor_app + " === " + acfaRef.Id_abstract);
            IList <SupplyParameter> spdao_list = BackEnd.spdao.list(acfaRef.Id_functor_app);

            foreach (SupplyParameter par in spdao_list)
            {
                if (par is SupplyParameterComponent)
                {
                    Console.WriteLine("PAR-C " + ((SupplyParameterComponent)par).Id_functor_app_actual);
                }
                else
                {
                    Console.WriteLine("PAR-P " + ((SupplyParameterParameter)par).Id_parameter);
                }
            }

            Component c;

            if (acfaRef.ParametersList.Count == 0)
            {
                if (cache.TryGetValue(acfaRef.Id_functor_app, out c))
                {
                    return(c);
                }
            }

            TreeNode root = GenerateTree.generate(actualParametersTop, acfaRef);

            Resolution.sort(root);

            TreeNode tn = root;

            while (tn != null)
            {
                Trace.Write(tn.Functor_app.Id_abstract + "@" + tn.GetHashCode() + "->");
                tn = tn.Next;
            }

            writeTreeNode(root);

            Console.WriteLine("AFTER Resolution.sort(root)");

            c = Resolution.tryGeneralize(root, root);

            Console.WriteLine("AFTER Resolution.tryGeneralize(root, root) --- " + (c == null));

            if (acfaRef.ParametersList.Count == 0)
            {
                cache.Add(acfaRef.Id_functor_app, c);
            }

            Console.WriteLine("FINISH - FIND HASH COMPONENT");

            return(BackEnd.cdao.retrieve_libraryPath(c.Library_path));;             // if c is null, there is not an implementation ....
        }
예제 #17
0
        public IList <string> fetchReferences(IDictionary <string, AbstractComponentFunctorApplication> pars)
        {
            Console.WriteLine("ENTER fetchReferences - id_abstract=" + this.Id_abstract + ", id_interface=" + this.Id_interface);

            foreach (KeyValuePair <string, AbstractComponentFunctorApplication> y in pars)
            {
                if (y.Key != null && y.Value != null)
                {
                    Console.WriteLine("key=" + y.Key + ", value=" + y.Value.Id_abstract);
                }
                else
                {
                    Console.WriteLine("somthing strange : " + (y.Key == null ? "null" : y.Key.ToString()) + " , " + (y.Value == null ? "null" : y.Value.ToString()));
                }
            }

            IList <string> refs = new List <string>();

            AbstractComponentFunctor            cThis     = br.ufc.pargo.hpe.backend.DGAC.BackEnd.acfdao.retrieve(this.Id_abstract);
            AbstractComponentFunctorApplication cSuperApp = br.ufc.pargo.hpe.backend.DGAC.BackEnd.acfadao.retrieve(cThis.Id_functor_app_supertype);

            if (cSuperApp != null)
            {
                AbstractComponentFunctor acfsuper = br.ufc.pargo.hpe.backend.DGAC.BackEnd.acfdao.retrieve(cSuperApp.Id_abstract);
                IDictionary <string, AbstractComponentFunctorApplication> parsSuper = null;
                collectParameters(pars, cSuperApp, out parsSuper);

                string[] id_interface_super_list = Interface.splitIDs(this.Id_interface_super);
                Console.WriteLine("fetchReferences: id_interface_super_list.Length = " + id_interface_super_list.Length + ", this.Id_Interface_super=" + this.Id_interface_super);
                foreach (string sss in id_interface_super_list)
                {
                    Console.WriteLine("fetchReference - SUPER: " + sss);
                }

                foreach (string id_interface_super in id_interface_super_list)
                {
                    Interface iSuper = br.ufc.pargo.hpe.backend.DGAC.BackEnd.idao.retrieve(cSuperApp.Id_abstract, id_interface_super);
                    foreach (string iref in iSuper.fetchReferences(parsSuper))
                    {
                        refs.Add(iref);
                    }
                    string refname = LoaderApp.buildDllName(acfsuper.Library_path, iSuper.Assembly_string);
                    if (!refs.Contains(refname))
                    {
                        refs.Add(refname);
                    }
                }
            }

            // Traverse slices.
            IList <Slice> slices = br.ufc.pargo.hpe.backend.DGAC.BackEnd.sdao.listByInterface(Id_abstract, Id_interface);

            foreach (Slice s in slices)
            {
                Console.WriteLine("SLICE (fetchReference): " + Id_abstract + ":" + Id_interface + ":" + s.Id_inner + " - " + s.PortName);

                InnerComponent ic = br.ufc.pargo.hpe.backend.DGAC.BackEnd.icdao.retrieve(Id_abstract, s.Id_inner);
                if (ic != null)
                {
                    AbstractComponentFunctorApplication acfa = null;
                    IDictionary <string, AbstractComponentFunctorApplication> parsSlice = null;

                    // ---------------------------------------------------------------------------------------
                    if (!ic.Parameter_top.Equals(""))
                    {
                        if (!pars.TryGetValue(ic.Parameter_top, out acfa))
                        {
                            acfa = br.ufc.pargo.hpe.backend.DGAC.BackEnd.acfadao.retrieve(ic.Id_functor_app);
                            Console.WriteLine("fetchReferences - TRACE 1.1 - ic.Parameter_top=" + ic.Parameter_top + ", acfa.Id_abstract=" + acfa.Id_abstract);
                        }
                        else
                        {
                            Console.WriteLine("fetchReferences - TRACE 1.2 - ic.Parameter_top=" + ic.Parameter_top + ", acfa.Id_abstract=" + acfa.Id_abstract + ", ic.id_inner=" + ic.Id_inner);
                        }
                    }
                    else
                    {
                        acfa = br.ufc.pargo.hpe.backend.DGAC.BackEnd.acfadao.retrieve(ic.Id_functor_app);
                        Console.WriteLine("fetchReferences - TRACE 2 - acfa.Id_abstract=" + acfa.Id_abstract);
                    }

                    collectParameters(pars, acfa, out parsSlice);

                    Console.WriteLine("RETRIEVE BY MATCHING: " + acfa.Id_abstract + "," + ic.Id_abstract_inner + "," + s.Id_interface_slice);
                    Interface[] i_list = br.ufc.pargo.hpe.backend.DGAC.BackEnd.idao.retrieveByMatching(acfa.Id_abstract, ic.Id_abstract_inner, s.Id_interface_slice);

                    if (i_list == null || i_list.Length == 0)
                    {
                        Console.WriteLine("i is null : " + acfa.Id_abstract + "," + ic.Id_abstract_inner + "," + s.Id_interface_slice);
                    }
                    AbstractComponentFunctor acfSlice = br.ufc.pargo.hpe.backend.DGAC.BackEnd.acfdao.retrieve(acfa.Id_abstract);

                    foreach (Interface i in i_list)
                    {
                        IList <string> refsSlice = i.fetchReferences(parsSlice);

                        foreach (string r in refsSlice)
                        {
                            if (!refs.Contains(r))
                            {
                                refs.Add(r);
                            }
                        }

                        string refname = LoaderApp.buildDllName(acfSlice.Library_path, i.Assembly_string);
                        if (!refs.Contains(refname))
                        {
                            refs.Add(refname);
                        }
                    }
                }
            }

            Console.WriteLine("EXIT fetchReferences - id_abstract=" + this.Id_abstract + ", id_interface=" + this.Id_interface);
            return(refs);
        }
		public int insert(AbstractComponentFunctorApplication ac)
		{
			return insert (ac, 0);
		}
예제 #19
0
        public static TreeNode generate(IDictionary <string, int> actualParametersTop, AbstractComponentFunctorApplication acfaRef)
        {
            //foreach (KeyValuePair<string,int> parTop in actualParametersTop)
            //	Console.WriteLine ("actualParametersTop[" + parTop.Key + "] = " + parTop.Value);

            //foreach (KeyValuePair<string,int> parTop in acfaRef.ParametersList)
            //	Console.WriteLine ("acfaRef.ParametersList[" + parTop.Key + "] = " + parTop.Value);

            IDictionary <TreeNode, int> level_log = new Dictionary <TreeNode, int> ();

            //Console.WriteLine("begin generate " + acfaRef.Id_functor_app);
            mmm = new Dictionary <String, String>();

            IDictionary <int, TreeNode> memory = new Dictionary <int, TreeNode>();

            IList <AbstractComponentFunctorApplication> lll = new List <AbstractComponentFunctorApplication>();

            lll.Add(acfaRef);

            TreeNode  root  = new TreeNode(lll, null);
            ArrayList queue = new ArrayList();

            queue.Add(root);

            level_log.Add(root, 0);

            while (queue.Count != 0)
            {
                TreeNode nodeRef = (TreeNode)queue[0];

                int level = level_log[nodeRef];
                //Console.WriteLine ("ENTERING LEVEL " + level);

                int id_abstract           = nodeRef.Functor_app.Id_abstract;
                int id_functor_app_actual = nodeRef.Functor_app.Id_functor_app;
                int id_abstract_top       = nodeRef.Functor_app_top.Id_abstract;

                //Console.WriteLine("Dequeue LOOP " + id_functor_app_actual);

                queue.RemoveAt(0);

                IList <SupplyParameter> parameterList = br.ufc.pargo.hpe.backend.DGAC.BackEnd.spdao.list2(id_functor_app_actual);
                foreach (SupplyParameter sp in parameterList)
                {
                    bool flag_par = false;
                    //	Console.WriteLine("generate LOOP " + sp.Id_parameter + "," + sp.Id_functor_app + "IN LEVEL " + level);
                    bool freeVariable = false;

                    string parameter_id = sp.Id_parameter;

                    AbstractComponentFunctorApplication acfaTop = null;
                    if (id_abstract_top != id_abstract)
                    {
                        AbstractComponentFunctorParameter acfpTop = br.ufc.pargo.hpe.backend.DGAC.BackEnd.acfpdao.retrieve(id_abstract_top, parameter_id);
                        acfaTop = acfpTop == null ? null : br.ufc.pargo.hpe.backend.DGAC.BackEnd.acfadao.retrieve(acfpTop.Bounds_of);
                        if (acfaTop == null)
                        {
                            AbstractComponentFunctorParameter acfp = br.ufc.pargo.hpe.backend.DGAC.BackEnd.acfpdao.retrieve(id_abstract, parameter_id);
                            acfaTop = acfp == null ? null : br.ufc.pargo.hpe.backend.DGAC.BackEnd.acfadao.retrieve(acfp.Bounds_of);
                        }
                    }
                    else
                    {
                        AbstractComponentFunctorParameter acfp = br.ufc.pargo.hpe.backend.DGAC.BackEnd.acfpdao.retrieve(id_abstract, parameter_id);
                        acfaTop = acfp == null ? null : br.ufc.pargo.hpe.backend.DGAC.BackEnd.acfadao.retrieve(acfp.Bounds_of);
                    }

                    //Console.WriteLine("acfaTop is null ? " + (acfaTop==null));

                    AbstractComponentFunctorApplication acfaActual = null;
                    if (sp is SupplyParameterComponent)
                    {
                        SupplyParameterComponent spc = (SupplyParameterComponent)sp;
                        //	Console.WriteLine ("acfaActual 1 ??? " + spc.Id_functor_app_actual);
                        acfaActual = br.ufc.pargo.hpe.backend.DGAC.BackEnd.acfadao.retrieve(spc.Id_functor_app_actual);
                        if (acfaActual == null)
                        {
                            throw new FreeVariableException();
                        }
                        //flag_par = true;
                    }
                    else if (sp is SupplyParameterParameter)
                    {
                        SupplyParameterParameter spp = (SupplyParameterParameter)sp;
                        int Id_functor_app_actual    = 0;

                        //	Console.WriteLine ("****** parameter_id#??? =" + parameter_id + "#" + sp.Id_functor_app);
                        if (!(flag_par = acfaRef.ParametersList.TryGetValue(parameter_id + "#" + sp.Id_functor_app, out Id_functor_app_actual)))
                        {
                            acfaRef.ParametersList.TryGetValue(parameter_id, out Id_functor_app_actual);
                        }

                        //	Console.WriteLine (" acfaRef.ParametersList.Count = " + acfaRef.ParametersList.Count);
                        //	foreach (KeyValuePair<string,int> p in acfaRef.ParametersList)
                        //		Console.WriteLine("acfaRef.ParametersList -- " + p.Key + " -> " + p.Value);

                        if (Id_functor_app_actual <= 0) // LOOK AT THE TOP PARAMETERS
                        {
                            bool found = actualParametersTop.TryGetValue(spp.Id_argument, out Id_functor_app_actual);
                            //	    Console.WriteLine (" actualParametersTop.Count = " + actualParametersTop.Count);
                            //	    foreach (KeyValuePair<string,int> p in actualParametersTop)
                            //		     Console.WriteLine("actualParametersTop -- " + p.Key + " -> " + p.Value);
                            if (!found)
                            {
                                string key = spp.Id_argument + "#" + sp.Id_functor_app;
                                //		Console.WriteLine ("key ??? " + key);
                                acfaRef.ParametersList.TryGetValue(key, out Id_functor_app_actual);
                            }

                            //	Console.WriteLine ("spp.Id_parameter_actual ??? " + spp.Id_argument);
                            //	Console.WriteLine ("found ??? " + found);
                        }
                        //	Console.WriteLine ("acfaRef ??? " + acfaRef.Id_functor_app);
                        //	Console.WriteLine ("parameter_id ??? " + parameter_id);
                        //	Console.WriteLine ("acfaActual 2 ??? " + Id_functor_app_actual);
                        if (Id_functor_app_actual <= 0)
                        {
                            // FREE VARIABLE !!! USE THE BOUND !!!
                            //AbstractComponentFunctorApplication acfaParF = br.ufc.pargo.hpe.backend.DGAC.BackEnd.acfadao.retrieve(spp.Id_functor_app);
                            //AbstractComponentFunctorParameter parF = br.ufc.pargo.hpe.backend.DGAC.BackEnd.acfpdao.retrieve(acfaParF.Id_abstract,parameter_id);
                            //Id_functor_app_actual = parF.Bounds_of;
                            //Console.WriteLine ("FREE VARIABLE !!! BOUND=" + Id_functor_app_actual);
                            freeVariable = true;
                        }
                        acfaActual = br.ufc.pargo.hpe.backend.DGAC.BackEnd.acfadao.retrieve(Id_functor_app_actual);
                    }

                    //	Console.WriteLine ("acfaActual ??? " + acfaActual.Id_functor_app);

                    if (!freeVariable)
                    {
                        // LOOK FOR ACTUAL PARAMETER IDs for THE NEXT ITERATIONS !!!
                        //	Console.WriteLine ("acfaTop.Id_functor_app = " + acfaTop.Id_functor_app);
                        IList <SupplyParameter> sss = br.ufc.pargo.hpe.backend.DGAC.BackEnd.spdao.list(acfaTop.Id_functor_app);
                        foreach (SupplyParameter sssx in sss)
                        {
                            if (sssx is SupplyParameterComponent)
                            {
                                SupplyParameterComponent ssxc = (SupplyParameterComponent)sssx;
                                if (!mmm.ContainsKey(acfaActual.Id_functor_app + "." + ssxc.Id_parameter))
                                {
                                    mmm.Add(acfaActual.Id_functor_app + "." + ssxc.Id_parameter, ssxc.Id_parameter);
                                }
                            }
                            else if (sssx is SupplyParameterParameter)
                            {
                                SupplyParameterParameter ssxp = (SupplyParameterParameter)sssx;
                                if (!mmm.ContainsKey(acfaActual.Id_functor_app + "." + ssxp.Id_parameter))
                                {
                                    mmm.Add(acfaActual.Id_functor_app + "." + ssxp.Id_parameter, ssxp.Id_argument);
                                }
                            }
                        }

                        int    memory_key = acfaActual.Id_functor_app;
                        string parameter_id_2;
                        mmm.TryGetValue(id_functor_app_actual + "." + parameter_id, out parameter_id_2);
                        if (parameter_id_2 == null)
                        {
                            parameter_id_2 = parameter_id;
                        }
                        else
                        {
                            acfaRef.ParametersList.TryGetValue(parameter_id_2, out memory_key);
                        }

                        TreeNode node       = null;
                        bool     node_found = memory.TryGetValue(memory_key, out node);

                        //		foreach (KeyValuePair<string, string> ppp in mmm)
                        //			Console.WriteLine ("mmm[" + ppp.Key + "]=" + ppp.Value);
                        //		foreach (KeyValuePair<int, TreeNode> pair in memory)
                        //			Console.WriteLine ("memory: key=" + pair.Key + ", value=" + pair.Value.Functor_app.Id_functor_app);

                        if (!node_found)
                        {
                            IList <AbstractComponentFunctorApplication> generalizeSteps = buildGeneralizationSteps(acfaActual, acfaTop);

                            //			foreach (AbstractComponentFunctorApplication yyy in generalizeSteps)
                            //				Console.WriteLine("generate - " + yyy.Id_functor_app);

                            node = new TreeNode(generalizeSteps, nodeRef);
                            level_log.Add(node, level + 1);
                            node.addParameterIdSyn(parameter_id_2);
                            node.Parameter_id = parameter_id_2;
                            queue.Add(node);
                            //			Console.WriteLine("BEGIN " + parameter_id + "," + parameter_id_2 + "," + flag_par + " *** "  + node.Functor_app.Id_functor_app);
                            if (level == 0 || flag_par)
                            {
                                memory.Add(node.Functor_app.Id_functor_app /*parameter_id_2 + (flag_par ? sp.Id_functor_app.ToString () : "")*/, node);
                            }
                            //			else
                            //				Console.WriteLine ("LEVEL " + level);
                            //			Console.WriteLine("END" + parameter_id + "," + parameter_id_2);
                        }
                        else
                        {
                            //			Console.WriteLine ("parameter_id_2 = " + parameter_id_2 + (flag_par ? sp.Id_functor_app.ToString() : ""));
                            node.addParameterIdSyn(parameter_id_2);
                        }

                        nodeRef.addChild(node);
                    }
                    else
                    {
                    }
                }
            }

            //	Console.WriteLine("end generate " + root.Parameter_id + "," +  root.Functor_app.Id_functor_app);
            return(root);
        }
예제 #20
0
    public InnerComponent retrieve(int id_abstract_start, string id_inner)
    {
    	InnerComponent ic = null;

		int id_abstract = id_abstract_start;
		
		while (id_abstract > 0) 
		{
	        IDbConnection dbcon = Connector.DBcon;
	        IDbCommand dbcmd = dbcon.CreateCommand();
	        string sql =
	            "SELECT id_abstract_owner, id_inner, id_functor_app, id_abstract_inner, parameter_top, transitive, public, multiple " +
	            "FROM innercomponent " +
	            "WHERE id_abstract_owner=" + id_abstract + " AND " +
	                  "id_inner like '" + id_inner + "'";
	        dbcmd.CommandText = sql;
	        IDataReader reader = dbcmd.ExecuteReader();
	        if (reader.Read())
	        {
	            ic = new InnerComponent();
	
	            ic.Id_abstract_owner = (int)reader["id_abstract_owner"];
	            ic.Id_inner = (string)reader["id_inner"];
	            ic.Id_functor_app = (int)reader["id_functor_app"];
	            ic.Id_abstract_inner = (int)reader["id_abstract_inner"];
	            ic.Parameter_top = (string)reader["parameter_top"];
	            ic.Transitive = ((int)reader["transitive"])==0 ? false : true;
	            ic.IsPublic = ((int)reader["public"]) == 0 ? false : true;
				ic.Multiple = ((int)reader["multiple"]) == 0 ? false : true;
	        }//if
	        // clean up
	        reader.Close();
	        reader = null;
	        dbcmd.Dispose();
	        dbcmd = null;
			
			if (ic==null) 
			{				
                AbstractComponentFunctor acf = br.ufc.pargo.hpe.backend.DGAC.BackEnd.acfdao.retrieve(id_abstract);
                //Console.WriteLine("acf is null ? " + (acf==null) + ", " + id_abstract);					
				if (acf == null)
						throw new Exception("ERROR: InnerComponentDAO.cs (retrieve) : id_abstract = " + id_abstract + "NOT FOUND when loonking for supertype ..." );

				if (acf.Id_functor_app_supertype > 0)
				{
				   AbstractComponentFunctorApplication acfa = br.ufc.pargo.hpe.backend.DGAC.BackEnd.acfadao.retrieve(acf.Id_functor_app_supertype);
				   
				   id_abstract = acfa.Id_abstract;
				}
				else 
				   id_abstract = -1;
				Console.WriteLine("InnerComponentDAO.cs - GOING TO SUPERTYPE " + id_abstract + " - ACF was null ?" + (acf == null));
			} else
				   id_abstract = -1;
			
		}
			
			if (ic==null) 
			{
				Console.WriteLine("InnerComponentDAO.cs: INNER NOT FOUND " + id_abstract_start + "," + id_inner);
			}
			
        return ic;

    }//retrieve
예제 #21
0
        private void collectParameters(IDictionary <string, AbstractComponentFunctorApplication> pars,
                                       AbstractComponentFunctorApplication acfa,
                                       out IDictionary <string, AbstractComponentFunctorApplication> parsSlice)
        {
            IList <SupplyParameter> spList = br.ufc.pargo.hpe.backend.DGAC.BackEnd.spdao.list(acfa.Id_functor_app);

            parsSlice = new Dictionary <string, AbstractComponentFunctorApplication>();

            foreach (SupplyParameter sp in spList)
            {
                AbstractComponentFunctorApplication acfaPar = null;
                if (sp is SupplyParameterComponent)
                {
                    SupplyParameterComponent sp_ = (SupplyParameterComponent)sp;
                    acfaPar = br.ufc.pargo.hpe.backend.DGAC.BackEnd.acfadao.retrieve(sp_.Id_functor_app_actual);
                    parsSlice.Add(sp_.Id_parameter, acfaPar);
                    Console.WriteLine("collectParameter -TRACE 1 " + sp_.Id_parameter + ":" + acfaPar.Id_abstract);
                }
                else if (sp is SupplyParameterParameter)
                {
                    SupplyParameterParameter sp_ = (SupplyParameterParameter)sp;
                    acfaPar = null;
                    Console.WriteLine("collectParameter -TRACE 2 " + "#" + sp_.Id_functor_app + sp_.Id_parameter);

                    pars.TryGetValue("#" + sp_.Id_functor_app + sp_.Id_parameter, out acfaPar);
                    if (acfaPar == null)
                    {
                        Console.WriteLine("collectParameter -TRACE 3 " + sp_.Id_argument);

                        if (pars.TryGetValue(sp_.Id_argument, out acfaPar))
                        {
                            parsSlice.Add(sp_.Id_parameter, acfaPar);
                            Console.WriteLine("collectParameter -TRACE 4 " + sp_.Id_parameter + " : " + acfaPar.Id_abstract);
                        }
                        else
                        {
                            AbstractComponentFunctorParameter acfp = br.ufc.pargo.hpe.backend.DGAC.BackEnd.acfpdao.retrieve(Id_abstract, sp_.Id_argument);
                            if (acfp == null)
                            {
                                acfp = br.ufc.pargo.hpe.backend.DGAC.BackEnd.acfpdao.retrieve(sp_.Id_abstract, sp_.Id_parameter);
                            }
                            acfaPar = br.ufc.pargo.hpe.backend.DGAC.BackEnd.acfadao.retrieve(acfp.Bounds_of);
                            parsSlice.Add(sp_.Id_parameter, acfaPar);
                            Console.WriteLine("collectParameter -TRACE 5 " + sp_.Id_parameter + " : " + acfaPar.Id_abstract);
                        }
                    }
                    else
                    {
                        Console.WriteLine("collectParameter -TRACE 6 " + "#" + sp_.Id_functor_app + sp_.Id_parameter + " : " + acfaPar.Id_abstract);
                        parsSlice.Add(sp_.Id_parameter, acfaPar);
                    }


                    /* else
                     * {
                     *  throw new Exception("ERROR !!!! collectParameters (Interface.cs)");
                     * }*/
                }

                collectFV(acfaPar, pars, parsSlice);
            }
        }
        internal SliceExposed retrieveContainerByOriginal(
            string id_inner_original,
            string id_interface_slice_original,
            int id_abstract_start,
            string id_interface_owner,
            string id_inner_owner)
        {
            int          id_abstract = id_abstract_start;
            SliceExposed se          = null;

            while (id_abstract > 0)
            {
                IDbConnection dbcon = Connector.DBcon;
                IDbCommand    dbcmd = dbcon.CreateCommand();
                string        sql   =
                    "SELECT id_abstract, id_inner, id_interface_slice, id_inner_owner, id_interface_slice_owner, id_inner_original, id_interface_slice_original " +
                    "FROM sliceexposed " +
                    "WHERE id_inner_original like '" + id_inner_original + "' and " +
                    "id_interface_slice_original like '" + id_interface_slice_original + "' and " +
                    "id_abstract = " + id_abstract + " and " +
                    "id_interface_slice_owner like '" + id_interface_owner + "' and " +
                    "id_inner_owner like '" + id_inner_owner + "'";
                dbcmd.CommandText = sql;
                Console.WriteLine(sql);
                IDataReader reader = dbcmd.ExecuteReader();
                if (reader.Read())
                {
                    se                    = new SliceExposed();
                    se.Id_inner           = (string)reader["id_inner"];
                    se.Id_abstract        = (int)reader["id_abstract"];
                    se.Id_interface_slice = (string)reader["id_interface_slice"];
//	                se.Slice_replica = (int)reader["slice_replica"];
                    se.Id_inner_owner           = (string)reader["id_inner_owner"];
                    se.Id_interface_slice_owner = (string)reader["id_interface_slice_owner"];
//	                se.Slice_replica_owner = (int)reader["slice_replica_owner"];
                    se.Id_inner_original           = (string)reader["id_inner_original"];
                    se.Id_interface_slice_original = (string)reader["id_interface_slice_original"];
                }
                //if
                // clean up
                reader.Close();
                reader = null;
                dbcmd.Dispose();
                dbcmd = null;

                if (se == null)
                {
                    AbstractComponentFunctor acf = br.ufc.pargo.hpe.backend.DGAC.BackEnd.acfdao.retrieve(id_abstract);
                    if (acf.Id_functor_app_supertype > 0)
                    {
                        AbstractComponentFunctorApplication acfa = br.ufc.pargo.hpe.backend.DGAC.BackEnd.acfadao.retrieve(acf.Id_functor_app_supertype);
                        id_abstract = acfa.Id_abstract;
                    }
                    else
                    {
                        id_abstract = -1;
                    }
                }
                else
                {
                    id_abstract = -1;
                }
            }

            return(se);
        }
        }//list2

        public IList <Slice> listByInterface(int id_abstract_start, string id_interface_start)
        {
            IList <Tuple <int, string> > queue = new List <Tuple <int, string> > ();

            queue.Add(new Tuple <int, string> (id_abstract_start, id_interface_start));

            IDictionary <string, string> mem = new Dictionary <string, string>();
            IList <Slice> list = new List <Slice>();

            while (queue.Count > 0)
            {
                int    id_abstract  = queue[0].Item1;
                string id_interface = queue[0].Item2;
                queue.RemoveAt(0);

                IDbConnection dbcon = Connector.DBcon;
                IDbCommand    dbcmd = dbcon.CreateCommand();
                string        sql   =
                    "SELECT id_abstract, " +
                    "id_interface, " +
                    "id_interface_slice, " +
                    "id_inner, " +
                    "transitive, " +
                    "property_name " +
                    "FROM slice " +
                    "WHERE id_abstract=" + id_abstract + " and id_interface like '" + id_interface + "'";
                dbcmd.CommandText = sql;
                Console.WriteLine(sql);
                IDataReader reader = dbcmd.ExecuteReader();
                while (reader.Read())
                {
                    Slice s = new Slice();
                    s.Id_abstract        = (int)reader["id_abstract"];
                    s.Id_interface       = (string)reader["id_interface"];
                    s.Id_interface_slice = (string)reader["id_interface_slice"];
                    s.Id_inner           = (string)reader["id_inner"];
                    s.Transitive         = ((int)reader["transitive"]) == 0 ? false : true;
                    s.PortName           = (string)reader["property_name"];
                    //if (!mem.ContainsKey(s.Id_inner))
                    //{
                    //   mem.Add(s.Id_inner, s.Id_inner);
                    list.Add(s);
                    //}
                }    //while

                // clean up
                reader.Close();
                reader = null;
                dbcmd.Dispose();
                dbcmd = null;

                AbstractComponentFunctor acf = br.ufc.pargo.hpe.backend.DGAC.BackEnd.acfdao.retrieve(id_abstract);
                if (acf.Id_functor_app_supertype > 0)
                {
                    AbstractComponentFunctorApplication acfa = br.ufc.pargo.hpe.backend.DGAC.BackEnd.acfadao.retrieve(acf.Id_functor_app_supertype);
                    Interface i = br.ufc.pargo.hpe.backend.DGAC.BackEnd.idao.retrieve(id_abstract, id_interface);
                    id_abstract = acfa.Id_abstract;
                    string[] id_interface_super_list = Interface.splitIDs(i.Id_interface_super);
                    foreach (string id_interface_super in id_interface_super_list)
                    {
                        queue.Add(new Tuple <int, string> (id_abstract, id_interface_super));
                    }
                }
                else
                {
                    id_abstract = -1;
                }
            }

            return(list);
        }//list