business architecture modelling in choose: a visual...
TRANSCRIPT
UNIVERSITEIT GENT
FACULTEIT ECONOMIE EN BEDRIJFSKUNDE
ACADEMIEJAAR 2012– 2013
Business architecture modelling in CHOOSE: a visual application for
Android tablets
Masterproef voorgedragen tot het bekomen van de graad van
Master of Science in de Toegepaste Economische Wetenschappen: Handelsingenieur
Joeri Maes
onder leiding van
Prof. Dr. Geert Poels en Maxime Bernaert
UNIVERSITEIT GENT
FACULTEIT ECONOMIE EN BEDRIJFSKUNDE
ACADEMIEJAAR 2012– 2013
Business architecture modelling in CHOOSE: a visual application for
Android tablets
Masterproef voorgedragen tot het bekomen van de graad van
Master of Science in de Toegepaste Economische Wetenschappen: Handelsingenieur
Joeri Maes
onder leiding van
Prof. Dr. Geert Poels en Maxime Bernaert
Business architecture modelling in CHOOSE: a visual application for Android tablets I
PERMISSION
Ondergetekende verklaart dat de inhoud van deze masterproef mag geraadpleegd en/of
gereproduceerd worden, mits bronvermelding.
Joeri Maes
Business architecture modelling in CHOOSE: a visual application for Android tablets II
Foreword
Writing a master dissertation was not an easy task, but I was eager to accept this challenge.
The result would not have been possible without the help and support of many. I would like
to extend my sincere gratitude to all of those who enabled me to do this.
I want to thank my promoter Prof. Dr. Geert Poels and Maxime Bernaert for reaching the
interesting subject to me. I want to thank them for the critical insights, their advice, their
guidance during the making of this thesis and the opportunities they gave me. This master
dissertation would not have been possible without the time, support and dedication of these
two people.
Further I want to thank the people from Cavalier and Topglass to give me the opportunity to
do a case study in the respective firms. I want to thank them for their enthusiasm, help and
especially the feedback during the development of the software tool.
I also wish to thank all the people who read this master dissertation very carefully. Their
critical evaluation and comments have certainly given this thesis an additional value.
Finally, I want to address a special word of thanks to my parents, friends and my immediate
environment, who were always with me with the necessary moral support and for giving
advice when I faced difficulties.
Joeri Maes
May 21, 2013
Business architecture modelling in CHOOSE: a visual application for Android tablets III
Table of contents
List of tables .......................................................................................................................... V
List of figures ........................................................................................................................ VI
List of Code snippets ............................................................................................................ VII
Abstract ..........................................................................................................................1 1.
Introduction ....................................................................................................................2 2.
Research methodology ...................................................................................................4 3.
Theoretical background ..................................................................................................5 4.
4.1. Information Management ........................................................................................5
4.2. Enterprise Architecture ............................................................................................6
4.3. Enterprise Architecture in SME’s ............................................................................10
4.4. The CHOOSE metamodel ........................................................................................10
4.5. Need for software tool support ..............................................................................12
Software tool prerequisites and development ..............................................................13 5.
5.1. The importance of prerequisites.............................................................................14
5.2. Type of software ....................................................................................................14
5.3. Problem Definition, software requirements and specifications ...............................14
5.4. Database design and implementation ....................................................................16
5.4.1. Database model development .........................................................................16
5.4.2. Database model implementation in Android ....................................................24
5.4.3. Implementation of a content provider in Android ..............................................26
5.4.4. Comparison of both implementations ..............................................................27
5.5. Usability .................................................................................................................28
5.5.1. User interface design ......................................................................................28
5.5.2. Drawing of the graph on the screen .................................................................30
Business architecture modelling in CHOOSE: a visual application for Android tablets IV
5.5.3. Automatically drawing the architecture ............................................................37
5.5.4. Conclusion ......................................................................................................38
Use of the tool ..............................................................................................................38 6.
6.1. Edit .........................................................................................................................38
6.2. View .......................................................................................................................47
6.3. Analyse ...................................................................................................................48
Testing: Case studies .....................................................................................................49 7.
7.1. First case-study: Cavalier ........................................................................................49
7.2. Second case-study: TopGlass ..................................................................................50
Conclusion ....................................................................................................................50 8.
8.1. General conclusion .................................................................................................50
8.2. Limitations and recommendations for further research..........................................51
References ...........................................................................................................................53
Appendices ...........................................................................................................................57
Appendix 1: ChooseProvider implementation ...................................................................57
Appendix 2: GraphProvider implementation .....................................................................64
Appendix 3: The InfiniteScrollView class ...........................................................................67
Appendix 4: Drawing behaviour of the composition relationship ......................................69
Appendix 5: Implementation of the force-based algorithm ...............................................71
Appendix 6: CD with source code, installation file and software project ...........................72
Business architecture modelling in CHOOSE: a visual application for Android tablets V
List of tables
Table 1: Average cost of fixing defects (McConnell 2004) .....................................................14
Business architecture modelling in CHOOSE: a visual application for Android tablets VI
List of figures
Figure 1: Research steps (Bernaert, Poels et al. 2013) .............................................................4
Figure 2: Amsterdam Information Management Model (Maes 2007) .....................................6
Figure 3: Bow tie model (Jonkers et al. 2009)..........................................................................8
Figure 4: Enterprise Architecture Framework (data: Schekkerman 2005) ...............................9
Figure 5: Enterprise Architecture Tools (data: Schekkerman 2005) .........................................9
Figure 6: The four dimensions of the CHOOSE metamodel (Bernaert, Poels et al. 2013) .......11
Figure 7: The complete CHOOSE metamodel (Bernaert et al. 2013) ......................................12
Figure 8: The essential CHOOSE metamodel (Bernaert et al. 2013) .......................................12
Figure 9: The choose metamodel used in the application .....................................................17
Figure 10: Example of a graph ..............................................................................................20
Figure 11: ER-diagram of a cyclic directed graph ...................................................................22
Figure 12: Relational database model of a cyclic directed graph ...........................................22
Figure 13: ER-diagram of the graph with positions and as-is/to-be functionality...................23
Figure 14: Relational database model with positions and as-is/to-be functionality ...............24
Figure 15: Relationship between the database, content provider and the application ..........25
Figure 16: The drag gesture (Google 2013) ...........................................................................29
Figure 17: The zoom gesture (Google 2013)..........................................................................29
Figure 18: Class diagram of the core of the application .........................................................30
Figure 19: Drawing of a goal node ........................................................................................35
Figure 20: Drawing of a composition relationship between two objects ...............................37
Figure 21: Creating entities dialog ........................................................................................39
Figure 22: Creation of entities ..............................................................................................40
Figure 23: Changing entities and creating relationships ........................................................42
Figure 24: Changing relationships .........................................................................................43
Figure 25: Automatic drawing of the architecture.................................................................45
Figure 26: Isolation of parts of the architecture and changing the visualization ....................46
Figure 27: The view panel .....................................................................................................47
Figure 28: Zooming ...............................................................................................................48
Figure 29: RACI chart ............................................................................................................49
Business architecture modelling in CHOOSE: a visual application for Android tablets VII
List of Code snippets
Code snippet 1: Simple database implementation in Android ...............................................25
Code snippet 2: Implementation of a content provider ........................................................27
Code snippet 3: Defning URI's in the Android framework .....................................................27
Code snippet 4: Applying the scrolling on the screen ............................................................31
Code snippet 5: The Node class ............................................................................................32
Code snippet 6: The Arc class................................................................................................33
Code snippet 7: The Graph class ...........................................................................................33
Code snippet 8: The NodeDrawBehavior interface ...............................................................34
Code snippet 9: The ArcDrawBehaviour interface .................................................................35
Code snippet 10: Calculating an intersection between two line segments ............................36
Business architecture modelling in CHOOSE: a visual application for Android tablets 1
Abstract 1.
Deze masterproef beschrijft de ontwikkeling van een tool voor het modelleren van de
bedrijfsarchitectuur gebruik makend van het CHOOSE metamodel.
Het CHOOSE metamodel is een metamodel ontwikkeld aan de Universiteit Gent en
modelleert de bedrijfsarchitectuur aan de hand van vier types entiteiten. Deze entiteiten zijn
de doelen van de onderneming, de actoren, de operaties en de objecten. Tussen deze
entiteiten kunnen verschillende relaties bestaan.
De theoretische achtergrond maakt duidelijk dat kleine en middelgrote ondernemingen
(KMO’s) nood hebben aan een dergelijke tool door hun eigen karakter, de technologische
vooruitgang en de competitieve omgeving waarin ze moeten opereren.
Twee belangrijke zaken van dit ontwikkelproces worden dieper besproken. Het eerste is de
implementatie van de data opslag en manipulatie in de applicatie. Het tweede is de
ontwikkeling van de visuele en gebruiksvriendelijke interface.
Twee verschillende datamodellen voor het opslaan en manipuleren van de data nodig voor
het CHOOSE model zijn bekeken. Het eerste datamodel is rechtstreeks afgeleid van het
CHOOSE metamodel en is meer geschikt voor academische doeleinden. Het tweede model is
gebaseerd op de datastructuur van een graaf. De tweede optie blijkt sneller te
implementeren en breder toepasbaar te zijn. Het nadeel van deze optie is echter dat de
data-integriteit binnen het CHOOSE model niet wordt gegarandeerd door het datamodel. Dit
model is daarom beter geschikt voor professionele doeleinden.
Het tweede aspect is de gebruiksvriendelijkheid en intuïtiviteit van de applicatie. Eigenaars
van KMO’s spenderen heel wat tijd aan het beheren van de dagelijkse aspecten van de
onderneming wat hen weinig ruimte en tijd geeft om op strategisch vlak na te denken. In
deze masterproef wordt een methode voor het visualiseren van een structuur van entiteiten
en relaties voorgesteld om de bedrijfsarchitectuur in KMO’s snel en gebruiksvriendelijk weer
te geven.
Business architecture modelling in CHOOSE: a visual application for Android tablets 2
Introduction 2.
The term architecture is not defined without ambiguity (Lankhorst 2009). A definition of
architecture in the IT-world is given by IEEE Standard 1471-2000 (IEEE Computer Society
2000) and is described as the fundamental organisation of a system embodied in its
components, their relationships to each other, and to the environment, and the principle
guiding its design and evolution. Enterprise architecture can been seen as the architecture of
an entire organisation (Jonkers, Lankhorst, ter Doest, Arab, Bosma & Wieringa 2006). More
specifically, it describes the principles, methods and models to shape the enterprise’s
business processes, IT, infrastructure and organisational structure (Lankhorst 2009).
In the past few decades, several frameworks to model the enterprise architecture (EA) of
companies have been developed. Examples of this include the Zachman Framework
(Zachman 1987), the Department of Defense Architecture Framework (DoDAF) (Urbaczewski
& Mrdalj 2006) and The Open Group Architecture framework (TOGAF) (Urbaczewski &
Mrdalj 2006). One aspect all these frameworks have in common is that they are used mostly
in large companies.
A new method, called CHOOSE (Bernaert 2013), is developed at the University of Ghent and
aims to model the business architecture in smaller enterprises. CHOOSE is an acronym of
“keep Control, by means of a Holistic Overview, based on Objectives and kept Simple, of
your Enterprise”. On the basis of four integrated models, the business architecture of a
company is represented (Bernaert & Poels, 2011). The first model is the know-why, in which
enterprises can define goals and the relationships between them. The second model is the
know-who, in which actors can be assigned to the previously defined goals. The know-how
of an enterprise is represented by the operations that comprise processes as well as
individual projects. Lastly, the know-what is represented by objects in the company. All
these entities in combination with their relationships form the business architecture of the
organization.
Business architecture modelling in CHOOSE: a visual application for Android tablets 3
In our current society, a new organizational form called the mobile enterprise (Basole 2007)
is rapidly emerging. Defining a mobile enterprise is difficult, as it can be narrowly as well as
very broadly defined. In a narrow way, specific mobile solutions are used for specific
problems in the organization (Basole 2007). In a broad way, mobile solutions can be part of
the strategy and are diffused through the entire company (Basole 2007). At the moment
different mobile solutions exist to do resource planning or customer relationship
management. Also managing the supply chain and the knowledge in an organization is
supported by mobile solutions. No tool support is available for the use of business
architecture in SMEs.
The goal of this master’s dissertation is to develop a tool for Android tablets that lets CEO’s
of small and medium-sized enterprises (SMEs) create the business architecture of their
companies using the CHOOSE method.
First, the applied methodology for the development of the application is described in
chapter 3. In chapter 4, the theoretical background for the development of this application is
given. In chapter 5, the prerequisites to the development of the software and the
implementation of two important parts of the software is given.
The first is the storage, manipulation and retrieval of the data necessary for such an
application. Multiple possibilities are examined. The second important aspect is caused by
the fact that lack specialized IT knowledge and technical skills (Bernaert and Poels 2011).
SMEs are also constantly busy dealing with day-to-day business, leaving them little room for
strategic issues (Bernaert and Poels 2011). On top of that, EA approaches are often complex
and difficult to implement, thus difficult to understand (Balabko & Wegmann 2006). Because
of the costs, it is hard to hire an expert or external consultant to help the SME’s (Bernaert,
Poels, Snoeck & De Backer 2013). These four reasons cause the need for an inexpensive,
easy-to-use software tool. The possibilities of tablets allow for a visual approach, which leads
generally to a higher usability of applications (Tselentis 2012). The implementation of this
visual approach is also described in chapter 5. Chapter 6 shows the features of the tool with
Business architecture modelling in CHOOSE: a visual application for Android tablets 4
the help of screenshots. Chapter 7 describes the case-studies that have been done for the
development of the application. In chapter 9 a conclusion of the whole process is given.
Research methodology 3.
In order to develop an enterprise architecture technique that has a high likelihood of
acceptance in SMEs, Bernaert and Poels proposed different research steps that need to be
taken which are shown in Figure 1 (Bernaert, Poels et al. 2013). In a first step, SMEs and EA
need to be analysed, which lead to criteria for a useful metamodel. After this, the
metamodel and a method to develop an EA model need to be created with the help of case
studies. This developed metamodel and method serve as input for the development of
software tool support, keeping in mind additional criteria for the development of software
tools. Using these research steps, the CHOOSE framework (metamodel, method and
software tool support) for business architecture is developed.
Figure 1: Research steps (Bernaert, Poels et al. 2013)
This master’s dissertation focuses on the development of the tool support. First, the
software tool prerequisites are determined, after which a first version of the application was
developed. Several flaws were discovered during a first case-study, which led to a second
development round and the further implementation of features in the software. A second
case-study revealed several other problems which led to a third development round. This
approach can be compared to the way an oyster forms a pearl, layer by layer and adding a
bit of calcium carbonate in the process, the development of the software starts with the
most simple version of the system that will run after which functionality is implemented and
Business architecture modelling in CHOOSE: a visual application for Android tablets 5
added on an iterative basis (McConnell 2004). This approach is suitable for sole developers
with no real computer science background to foreclose beginner mistakes and work in a
structured and clear way. In the description of the crucial parts of the software development
phase, the different iterations are taken together. The different aspects learned during each
iteration are summed up in the case-studies.
Theoretical background 4.
4.1. Information Management
Currently companies are confronted with a competitive and complex environment. Because
of that it is necessary to develop a unique strategy. Information Technology (IT) can help to
implement that strategy in an efficient manner and at low costs (Sessions 2012). The rise of
IT made business processes and IT very close related. An integrated and aligned approach is
in that light indispensable (Henderson & Venkatraman 1993). This business and IT alignment
becomes difficult to create because of miscommunication and non-communications. Many
IT people do not speak the language of business and vice versa (Maes 2007). An example of
an effort to bridge the gap between business and IT is the Amsterdam Information
Management Model displayed in Figure 2 (Maes 2007). In this model Information
management (light grey) is positioned and the relation between Business processes, IT and
information management becomes clear (dark grey). Managing these relationships means
that business and IT should be aligned, both on a strategic level and on an operational level.
Enterprise architecture can be seen as part of information management and is represented
by the middle row in the model in Figure 2. It is the consistent development of business
processes, information and IT. In this way, EA provides business-IT alignment from a
structural point of view (Maes 2007).
Business architecture modelling in CHOOSE: a visual application for Android tablets 6
Figure 2: Amsterdam Information Management Model (Maes 2007)
4.2. Enterprise Architecture
EA is broadly used to improve the alignment in companies (Radeke 2011; Tamm, Seddon,
Shanks & Reynolds. 2011;. Daneva & van Eck 2007; Lindström, Johnson, Johansson, Ekstedt
& Simonsson 2006). This can be both referring to the business-IT alignment as well as the
general strategical alignment of the business in a broader sense. Another important role of
EA is the communication ability among diverse groups and it provides a common ground for
discussion and decision making (Bernaert et al. 2013).
Architecture in general is defined as the fundamental organisation of a system embodied in
its components, their relationships to each other, and to the environment, and the principle
guiding its design and evolution. This definition is given by IEEE Standard 1471-2000 (IEEE
Computer Society 2000). Enterprise Architecture is more narrowly defined as the
architecture of an entire organisation (Jonkers et al. 2006). It describes the principles,
methods and models to shape the enterprise’s business processes, IT, infrastructure and
organisational structure (Lankhorst 2009). It guards the essentials of the business, while still
allowing for maximal flexibility and adaptability (Jonkers et al. 2006). Enterprise architecture
helps in showing the current environment and outline the future setting (Jonkers et al. 2006)
Enterprise
Architecture
Business architecture modelling in CHOOSE: a visual application for Android tablets 7
and is characterized by a holistic view on the company (Jonkers et al. 2006). In this way it
contributes to align the IT, business, operations and strategy in a company instead of looking
for local optimizations (Lankhorst 2009). With enterprise architecture it is easier to convert
strategy to operations (Lankhorst 2009). Because enterprise architecture brings together
information from different domains, it is important for the quality that enterprise
architecture is understood by all those involved (Lankhorst 2009).
The interest in EA is grown by the complexity of information systems. Also the evolution to a
boundary less organisation has strengthen the interest in EA (Van Sante, Kemmeren, Rouw,
Kerssens & van den Bent 2008). Because of the amount of information flowing in the inside
and to the outside of the enterprise, changes in the information systems are dangerous. EA
helps reducing these risks by designing models out of different perspectives. A consistent
architecture supports a consistent customer approach. Nowadays enterprises wants to have
a multi-channel approach which EA makes easier to implement. Furthermore, the Clinger-
Cohen act (Public law 104-106, Feb 10, 1996) forces the federal government of the United
States to use IT architecture. Finally, there are numerous benefits which are on its own an
incentive use EA in an organization(Van Dullemen, Vermeulen, Morssink, Lendvai & van der
Zee 2008) because the strategy of the organisation is embodied in the EA (Lankhorst 2009).
On the long term there is a better business-IT alignment which causes the enterprise to be
able to react and grow faster with lower costs (Jonkers et al. 2006).
There are four key ingredients to a good EA model: A process, viewpoints, a language and a
repository. These elements can be found in the bow tie model shown in Figure 3 (Jonkers et
al. 2009). First there is a need for a process or a method for creating and maintaining
architectures. These can be supported by different guidelines, techniques and best practices.
The complexity of an enterprise nowadays needs different perspectives to determine what is
relevant. A second ingredient is therefore a set or classification of viewpoints. A good EA
framework also needs a language and a notation for describing architectures based on a
meta-model. Finally a repository is essential for storing architectural artefacts, possibly
containing predefined reference models. These four ingredients can be used to evaluate
different EA models.
Business architecture modelling in CHOOSE: a visual application for Android tablets 8
Figure 3: Bow tie model (Jonkers et al. 2009)
Multiple frameworks, models and tools to create the structure of the different components
and their relationships exist. According to a research of the Institute For Enterprise
Architecture Developments (IFEAD) at 79 respondents (Schekkerman 2005), the Zachman
Framework (Zachman 1996) is used the most as seen in Figure 4. A selfmade framework of
the enterprise was the second most used. Other important frameworks which are used are
the Department of Defense Architecture Framework (DoDAF) (Urbaczewski & Mrdalj 2006)
and The Open Group Architecture framework (TOGAF) (Jonkers et al. 2009, Urbaczewski &
Mrdalj 2006). According to other research (Session 2007) ninety procent uses one of the
following frameworks, Zachman Framework, TOGAF, the Federal Enterprise Architecture
Framework (FEAF) (Urbaczewski & Mrdalj 2006) or the Gartner Method (Session 2007).
Examples of tools (Figure 5) currently in use (Schekkerman 2005) include Microsoft office,
Microsoft Visio, System Architect (IBM 2013) and Aris (SoftwareAG 2013). The drawback is
that these tools are not disposing of analysis tools (Johnson, Johansson et al. 2007), nor are
they suitable for SMEs due to their specific nature. Next to this, they are not supporting the
CHOOSE metamodel, nor are they adapted towards an SME target group.
Business architecture modelling in CHOOSE: a visual application for Android tablets 9
Figure 4: Enterprise Architecture Framework (data: Schekkerman 2005)1
Figure 5: Enterprise Architecture Tools (data: Schekkerman 2005)
1 IAF, Capgemini's Integrated Architecture Framework
TAFIM, US Defense Technical Architecture Framework for Information
E2AF, Extended Enterprise Architecture Framework
Zachman Framework
24%
FEAF 9%
TOGAF 11%
IAF 3%
DoDAF 11%
TAFIM 2%
E2AF 9%
Organization own 22%
Other 9%
What kind of EA framework does your organization use?
None 1%
Microsoft Office Tools 29%
Ptech- 'Enterprise Framework'
1%
Microsoft Visio 33%
Casewise Modeler
2%
Telelogic- 'System
Architect' 15%
Troux- 'Metis' 1%
MEGA - 'Architecture
Tools' 2%
Aris Process Platform
5% Other 11%
What kind of EA tool is your organization using?
Business architecture modelling in CHOOSE: a visual application for Android tablets 10
4.3. Enterprise Architecture in SME’s
In recent years, the recognition for the need of EA in small and medium-sized enterprises
has risen. For these companies, EA is widely proposed as a means to manage complexity and
change (Jacobs, Kotzé et al. 2011). Due to the specific problems and characteristics of SMEs,
a different approach is necessary. Also in SME’s the concept of EA could be a good solution
for structure and overview problems (Bernaert et al. 2013). The current EA tools are
primarily targeted and used at large enterprises (Bernaert et al. 2013). This focus is hard to
justify as SMEs comprise up to 99% of all firms in the European Union while globally they
account for 99% of business and 40 to 50 per cent of the gross domestic product (GDP)
(Jacobs, Kotzé et al. 2011). Next to this, research findings based on large businesses can not
be generalized to small business (Aarabi, Saman,, Wong, Beheshti & Hemdi 2011).
One of the major causes preventing the growth of small enterprises is the lack of business
skills (Jacobs, Kotzé et al. 2011). Other than business skills, SMEs lack specialized IT
knowledge and technical skills (Bernaert and Poels 2011). SMEs are constantly busy dealing
with day-to-day business, leaving them little room for strategic issues (Bernaert and Poels
2011). On top of that, EA approaches are often complex and difficult to implement, thus
difficult to understand (Balabko & Wegmann 2006). Because of the costs, it is hard to hire an
expert or external consultant to help the SME’s (Bernaert et al. 2013). Although an EA in
SME’s can affect their success because this is correlated to higher levels of strategic
awareness (Bernaert et al. 2013). In this light, the CHOOSE metamodel for EA is being
developed (Bernaert, Poels et al. 2013). It is the first effort to provide an EA model to SME’s
(Bernaert et al. 2013).
4.4. The CHOOSE metamodel
The CHOOSE metamodel addresses the specificities and problems SMEs face by creating a
holistic overview of the business architecture layer of the EA. Because it is created for SME’s
it is kept simple but not too simple (Bernaert et al. 2013). The starting point of the CHOOSE
metamodel was the KAOS metamodel (Dardenne, Fickas & van Lamsweerde 1991; van
Business architecture modelling in CHOOSE: a visual application for Android tablets 11
Lamsweerde, Dardenne, Delcourt & Dubisy1991) and is adapted after multiple rounds of
action research (Susman & Evered 1978) to form the CHOOSE model.
Four dimensions are distinguished to create this holistic overview (Figure 6). A strategic
dimension or goal viewpoint (why), an active actor dimension (who), an operation dimension
for the behavioural part (how) and an object dimension for the description of the concepts
and relationships (what). Relationships exist between entities of different dimensions as well
as between entities of the same dimension. The creation of a business architecture in
CHOOSE thus involves creating specific entities of the four dimensions and modelling the
relationships between them.
Figure 6: The four dimensions of the CHOOSE metamodel (Bernaert, Poels et al. 2013)
There is a complete CHOOSE metamodel which is shown in Figure 7 and an essential
CHOOSE metamodel which is shown in Figure 8. The difference is that the essential model
excludes optional specializations and attributes and allows for SME’s to create an EA model
more quickly and easily (Bernaert, Poels et al. 2013). The essential CHOOSE metamodel
consists of four different types of entities corresponding to the previously explained
dimensions and various possible relationships between them. It is possible for relations to
exist between entities of different as well as the same types. An example of the former is the
input relationship between an object and an operation. An illustration of the latter is the
conflict relationship between two goals. The types of relationships between the different
entities are shown in Figure 7 and Figure 8.
Business architecture modelling in CHOOSE: a visual application for Android tablets 12
Figure 7: The complete CHOOSE metamodel (Bernaert et al. 2013)
Figure 8: The essential CHOOSE metamodel (Bernaert et al. 2013)
4.5. Need for software tool support
On the one hand, the lack of business and IT skills in enterprises causes the need for user-
friendly intuitive ways to model the business architecture in order for the enterprises to
have an overview of the company and to enable growth (Jacobs, Kotzé et al. 2011). On the
other hand we see that in our current society, a new organizational form, called the mobile
enterprise, is rapidly emerging (Basole 2007). Defining can be done in a narrow as well as a
broad way. In a narrow way, specific mobile solutions are used for specific problems in the
Business architecture modelling in CHOOSE: a visual application for Android tablets 13
organization. In a broad way, mobile solutions can be part of the strategy and are diffused
throughout the entire company (Basole 2007).
The combination of this particular need for tools with high usability and the trend of
increasing mobility creates the need for mobile applications to model the business
architecture. This can help with the process of becoming a mobile enterprise and can
leverage other information technology support systems. The use of the CHOOSE metamodel
for such a tool is further supported by the proposition that tool support should be based on
a comprehensive metamodel and should be capable of representing business architecture
information in customizable graphical and textual forms (Braun and Winter 2005).
Another reason for the development of tool support is the fact that although the trend is
decreasing, a lot of companies still use Microsoft office tools like Word, Excel or PowerPoint
to model their enterprise architecture (Schekkerman 2005). Other advantages include the
easy use of computational power for the analysis of the architecture. EA helps in showing
the current environment and outline the future setting (Jonkers, Lankhorst et al. 2006) and is
characterized by a holistic view on the company (Jonkers, Lankhorst et al. 2006). The
integration of the current environment and the future can be implemented in the tool by an
as-is/to-be analysis. Next to this, creating a holistic overview of the company is facilitated by
the graphic processing power of modern mobile devices.
Software tool prerequisites and development 5.
This chapter is dedicated to show the development of the application. First, the importance
of having software prerequisites is stressed after which the type of software and the
problem definition are determined. The development environment and framework is
introduced and a basic software architecture is developed. Two parts of the development
process are further elaborated. The first is the development of a data model, the second is
the implementation the visual approach of the user interface. When referring to a software
class or code which is not written in full in the paper either as a code snippet or an appendix
we refer to the CD in Appendix 6.
Business architecture modelling in CHOOSE: a visual application for Android tablets 14
5.1. The importance of prerequisites
Upstream prerequisites comprise determining the type of software you are working on,
defining the problem, determining the software requirements and developing a software
architecture (McConnell 2004). This will both lead to higher quality software as well as lower
development costs (McConnell 2004). Table 1 shows the estimated multiplier with which the
cost rises after an error has been detected. It shows for example that a problem that slipped
in during the requirements phase and has only been detected after the release of the
software will cost ten to hundred times as much to fix than if it was immediately detected
during the requirements stage.
Time detected
Time introduced
Requirements Architecture Construction System test Post-Release
Requirements 1 3 5-10 10 10-100
Architecture - 1 10 15 25-100
Construction - - 1 10 10-25 Table 1: Average cost of fixing defects (McConnell 2004)
5.2. Type of software
Different kinds of software ask for different kinds of approaches. Three common kinds of
software projects are business systems, mission-critical systems and embedded life-critical
systems (McConnell). In the case of the CHOOSE modelling tool it is clearly a business
system. Relevant typical good practices of business systems include a more informal
requirements specification and a combination of coding and designing the application.
5.3. Problem Definition, software requirements and specifications
The problem definition is already elaborated in the introduction. The problem faced is the
development of a tool for Android tablets that lets CEO’s of small and medium-sized
enterprises create the business architecture of their companies using the CHOOSE method.
The application will be developed for the Android operating system. An advantage of this
operating system is that from version 1.6 and up, all applications are backwards compatible.
Business architecture modelling in CHOOSE: a visual application for Android tablets 15
This means that every Android application specifically designed for an older version will run
on every newer version of the operating system.
Android version 3.x was designed specifically for tablets but was never a big success. In May
2013, 0.1% of all Android devices ran version 3.2 of the software. For version 3.0 and 3.1,
this is even less (Google 2013). Version 4.x of the Android Operating system was meant to
merge the mobile phone version and the tablet version and is currently used on more than
55% of all Android devices. On tablets this percentage is even higher. Because of the
improved enterprise support and security in Android 4.0, the application will be developed
for devices with Android 4.0 or higher.
The standard database management system for Android applications is SQLite (SQLite 2013).
This is a lightweight relational database management system with which the application will
be developed. It offers all functionality other systems are offering while keeping the load on
the device low.
Development for the Android operating system can be done with every text editor or
integrated development environment (IDE) using the java programming language in
combination with the Android framework. After installing the Java Development Kit (JDK),
files can be compiled from the command line using the Android software development kit
(SDK). To make it easier for developers to create applications for Android, Google has made
a plugin for the Eclipse IDE. This is the editor that will be used for the development of the
business architecture modelling application. To make the development process more robust,
the built-in GIT source code management possibilities of Eclipse are used. GIT is a version
control system allowing to save different versions of the same software. In this way it is
possible to work on a separate version of the software and thus preventing that the main
version breaks. The edited files which could have bug fixes or added features can then be
merged with the main version to build the software safely. It is also possible for older
versions to be retrieved using this system. Using the GIT system with local storage in
combination with a Dropbox account which synchronises the files with an online server
allows for the versioning of the application and security of the data.
Business architecture modelling in CHOOSE: a visual application for Android tablets 16
5.4. Database design and implementation
This chapter covers the database development of the application. Two options for the
development of a relational database model are taken into consideration. The first one is to
use the CHOOSE metamodel and generate a database model by mapping the entity-
relationship (ER) model to a relational database model using mapping rules. The second
option is to design the database representing a graph data structure. The development of
the relational database model of these options are elaborated in the next paragraphs. In this
stage of the development, no choice between both options has been made. Both models
have been implemented using the SQLite relational database system in the Android
development environment and their benefits and drawbacks will be shown. It is important to
note that the software design allows for the switching between both options without
affecting other parts of the software.
First, both relational database models are developed after which the implementation of
both these database models within the Android framework is shown. It is important to note
that the used database model is in no way definitive as it can be easily replaced without
having an impact on other parts of the software.
5.4.1. Database model development
5.4.1.1. Database model generation using the metamodel
In Figure 9 the used metamodel for the database design is shown. The figure shows an
earlier version of the CHOOSE metamodel when it was still in development.
Business architecture modelling in CHOOSE: a visual application for Android tablets 17
Figure 9: The choose metamodel used in the application
For the generation of a relational database model out of the ER-model ten mapping rules are
used. The relational database model will be noted as follows.
Table1 (primary key 1, foreign key 1, … , attribute 1, attribute 2, … ) Table2 (primary key 1, foreign key 1, … , attribute 1, attribute 2, … )
…
The names in the different entities might be not unique. Therefore an ID attribute is added
to every entity (e.g. Goal ID for Goal, Actor ID for Actor).
The first mapping rule is to create a table for every strong entity type in the ER-diagram with
all single attribute types of this entity type.
Goal (Goal ID, Name, Description) Actor (Actor ID, Name, Description) Object (Object ID, Name, Description) Operation (Operation ID, Name, Description)
The second mapping rule is to create a table for every weak entity type in the ER-diagram
with all single attribute types of this entity type.
Business architecture modelling in CHOOSE: a visual application for Android tablets 18
In this case, no weak entity types exist in this ER-model
The third mapping rule is for every binary 1:1 relationship placing the primary key of a
relation as foreign key in the other relationship.
There are no binary 1:1 relationships in the ER model in the ER-model
The fourth mapping rule is for every binary 1:* relationship placing the primary key of the
relationship created out of the owner-entity as foreign key in the other relationship.
There are no binary 1:* relationships in the ER-model
The fifth mapping rule is to create a new relation for every binary *:* relationship type.
Wish (Goal ID, Actor ID) Goal ID is a foreign key referring to Goal ID in Goal, NULL not allowed. Actor ID is a foreign key referring to Actor ID in Actor, NULL not allowed.
Assignment (Goal ID, Actor ID) Goal ID is a foreign key referring to Goal ID in Goal, NULL not allowed. Actor ID is a foreign key referring to Actor ID in Actor, NULL not allowed.
Performance (Operation ID, Actor ID) Operation ID is a foreign key referring to Operation ID in Operation, NULL not allowed. Actor ID is a foreign key referring to Actor ID in Actor, NULL not allowed.
Input (Operation ID, Object ID) Operation ID is a foreign key referring to Operation ID in Operation, NULL not allowed. Object ID is a foreign key referring to Object ID in Object, NULL not allowed.
Output (Operation ID, Object ID) Operation ID is a foreign key referring to Operation ID in Operation, NULL not allowed. Object ID is a foreign key referring to Object ID in Object, NULL not allowed.
Concern (Object ID, Goal ID) Object ID is a foreign key referring to Object ID in Object, NULL not allowed. Goal ID is a foreign key referring to Goal ID in Goal, NULL not allowed.
Operationalization (Goal ID, Operation ID) Goal ID is a foreign key referring to Goal ID in Goal, NULL not allowed. Operation ID is a foreign key referring to Operation ID in Operation, NULL not allowed.
Monitoring (Actor ID, Object ID) Actor ID is a foreign key referring to Actor ID in Actor, NULL not allowed.
Business architecture modelling in CHOOSE: a visual application for Android tablets 19
Object ID is a foreign key referring to Object ID in Object, NULL not allowed.
Control (Actor ID, Object ID) Actor ID is a foreign key referring to Actor ID in Actor, NULL not allowed. Object ID is a foreign key referring to Object ID in Object, NULL not allowed.
The sixth mapping rule is for every recursive 1:* relationship placing the primary key of a
relation that it presents and recursion is as a foreign key in the same relation.
There are no recursive 1:* relationships in the ER model of the CHOOSE Essential Metamodel.
The seventh mapping rule is to create a new relation for every recursive *:* relationship
type.
Includes( superOperation, subOperation) Conflict (conflictingGoal1, conflictingGoal2) Division (divisionActor1, divisionActor2)
Aggregation(Object_ID1,Object_ID2) Composition(Object_ID1,Object_ID2) Association(Object_ID1,Object_ID2) Specialization(Object_ID1,Object_ID2) and-relationship(Goal_ID1,Goal_ID2) or-relationship(Goal_ID1, Goal_ID2)
The eighth mapping rule is to create for every multiple attribute typing a new relation with
the attribute type and the attribute types of the primary key of the relation created by the
entity type and the multiple attribute type.
There are no multiple attribute types in the ER model of the CHOOSE Essential Metamodel
The ninth mapping rule is to create relations for every entity type en the relationship type at
complex relationship types.
There are no complex relationship types in the ER model of the CHOOSE Essential Metamodel
The tenth mapping rule consists of three possible methods. The first method is to create one
relation for every superclass and one relation for every subclass. The second method is to
create one relation for every subclass. The last method is to create one relation which
includes the superclass and all subclasses.
Business architecture modelling in CHOOSE: a visual application for Android tablets 20
There are no superclasses and subclasses in the ER model of the CHOOSE Essential Metamodel
5.4.1.2. Representing the business architecture by a graph
A structure of entities and the relationships between them can unambiguously be
represented by a graph data structure. A graph is a collection of objects called vertices that
can have relationships between them called edges. An example of a graph is shown in Figure
10 and is noted as shown in Equation 1 with G representing graph G, consisting of a set of
vertices (V) and a set of edges (E). Both the sets of vertices and nodes of the graph in Figure
10 are shown in Equation 2.
( )
Equation 1: Mathematical notation of a graph
( )
(( ) ( ) ( ) ( ) ( ) ( ) ( ) ( ))
Equation 2: Mathematical notation of the set of vertices and edges in graph G
The vertices, alphabetically labelled from A to H could represent a specific goal, actor, object
or operation as part of a CHOOSE business architecture model. The edges represent one of
the possible relationships between them. In this way, every entity of a CHOOSE model is
mapped to a vertex and every relationship is mapped to an edge. As an example, vertex A
and F could represent a goal and an object respectively. The relationship between them
would then be a concern relationship.
Figure 10: Example of a graph
Business architecture modelling in CHOOSE: a visual application for Android tablets 21
In the following three paragraphs, the properties of the graph for the representation of the
CHOOSE metamodel are further elaborated. First, the directedness of the graph is looked at,
after which the cyclicality and connectedness are discussed. These properties will have an
implication on how the data needs to be stored.
The graph in Figure 10 that serves as an illustration is an undirected graph, meaning that the
direction of the relationships between them have no meaning. In the example, edge (A, E)
has the same meaning as the edge (E, A). Several but not all of the relationships in the
essential CHOOSE metamodel have a different meaning depending on the direction of the
relationship. This is immediately clear using one of the self-referencing relationships. Taking
the example of the operation entity type, one operation could be part of another one.
Depending on the direction of the relationship, one is a constituent of the other. It is
therefore clear that the graph is a directed graph.
When it comes to the cyclicality, cyclical paths in the business architecture using the
CHOOSE method are common. Taking the simple example of a shoe factory, an employee
represented by an actor can perform a certain operation on a shoe represented by an
object. If this operation contributes to the goal of producing quality shoes which is also a
goal assigned to the employee, a cycle in the graph exists. When it comes to relationships
solely between entities of the same type, a cycle would lead to contradictions. For example,
If a goal A is a refinement of goal B which is in itself a refinement of goal C, it is impossible
for goal C to be a refinement of goal A. The existence of cycles in general means that the
graph is a cyclic graph.
During the construction of the business architecture, entities will be created that are not
linked to another one. Although the completed architecture will in an ideal case have no
unconnected parts, there will be such parts during the construction of the architecture. The
represented graph is therefore an unconnected graph and a connection from each node is
not obligatory.
The graph representing the CHOOSE metamodel is therefore a cyclic directed unconnected
graph. A simple graph without extra information like the one in Figure 10 can be either
Business architecture modelling in CHOOSE: a visual application for Android tablets 22
represented by only storing the edges or by storing both the vertices and edges. In the case
where more information needs to be stored about the vertices and the edges, storing them
both is unavoidable. This leads to the ER-diagram shown in Figure 11. To be able to store the
type of a node, a type attribute is added to both the Vertex and the Edge table. In the
application the Vertices are stored in the Node table and the Edges are stored in the Arc
table.
Figure 11: ER-diagram of a cyclic directed graph
This ER-diagram is then transformed to the relational database scheme in Figure 12 using the
mapping rules.
1) Node (id INT, name TEXT, type TEXT, description TEXT)
2) Node (id INT, name TEXT, type TEXT, description TEXT)
Arc (node id INT1, node ID INT2, type TEXT)
node ID INT 1 en node ID INT2 are foreign keys referring to id INT in Node,
NULL not allowed.
Because of the simplicity of the ER-model, the ER-diagram and the relational database model
are almost identical.
Figure 12: Relational database model of a cyclic directed graph
Business architecture modelling in CHOOSE: a visual application for Android tablets 23
While this database can represent the complete CHOOSE metamodel, features in the
software created the necessity for additional information in the database. Each node needs
to store its position in a two-dimensional pane as the user will be able to create an
architecture visually and can position the entities where he or she wants it. The
implementation of an as-is/to-be analysis can be done in several ways. The most
straightforward manner is to save different versions of the architecture. To do this, every
node and arc will have a version attribute. This leads to the following ER-diagram in Figure
13 and the relational database model in Figure 14.
Figure 13: ER-diagram of the graph with positions and as-is/to-be functionality
This ER-diagram is then transformed to the relational database scheme in Figure 14 using the
mapping rules.
1) Node (idINT, name TEXT, type TEXT, description TEXT, x INT, y INT, version INT)
3) Node (idINT, name TEXT, type TEXT, description TEXT, x INT, y INT, version INT)
Arc (node id INT1, node ID INT2, typeTEXT)
node ID INT 1 en node ID INT2 are foreign keys referring to id INT in Node,
NULL not allowed.
Business architecture modelling in CHOOSE: a visual application for Android tablets 24
Figure 14: Relational database model with positions and as-is/to-be functionality
5.4.2. Database model implementation in Android
The core of the business architecture modelling application consists of a SQLite database.
Using a SQLite database in the application is done by creating a class extending the
SQLiteOpenHelper class available in the Android Framework. It is important to note that this
class is declared by private and static access modifiers as we do not want the database to be
directly manipulated. It will be encapsulated by a content provider which is explained further
below. The following code in Code snippet 1 shows a basic implementation of a database
with one table which has an id and a name.
private static class ChooseDatabaseHelper extends SQLiteOpenHelper {
private static final String DATABASE_NAME = "ChooseDatabase"; private static final int DATABASE_VERSION = 1;
ChooseDatabaseHelper(Context context) { super(context, DATABASE_NAME, null, DATABASE_VERSION);
} @Override public void onCreate(SQLiteDatabase db) { final String CREATE_TABLE = "CREATE TABLE IF NOT EXISTS table(id INTEGER, name TEXT);"; db.beginTransaction(); try { db.execSQL(CREATE_TABLE); } catch (SQLException e) { e.printStackTrace(); } finally { b.setTransactionSuccessful(); } db.endTransaction();
}
Business architecture modelling in CHOOSE: a visual application for Android tablets 25
@Override public void onUpgrade(SQLiteDatabase db, int oldVersion, int newVersion) {
} }
Code snippet 1: Simple database implementation in Android
Both the database name and the database version are put in variables to use as it is a best
practice not to use hardcoded variables. The database version is important at the moment
multiple versions of the software are released. When an update is installed, the application
will look for the database version of the previously installed version. If the database version
is higher, the onUpgrade method will be triggered in which the alterations to the database
from one version to another can be specified. The onCreate method is called when the
application is started or the database is called for and creates the database.
In the case of a public access modifier instead of private, this database is ready to use. The
choice has been made to work with a data abstraction layer in the form of a content
provider. A content provider makes an abstraction of the underlying data, which means that
the user of the content provider does not know where the data comes from. In this case it is
the SQLite database, but it could be a remotely accessed database or a flat file. It allows for
the adding and manipulation of data from every application on the Android device. A visual
representation of the relationship between Android applications, the content provider and
the database is shown in Figure 15.
Figure 15: Relationship between the database, content provider and the application
Business architecture modelling in CHOOSE: a visual application for Android tablets 26
The choice for a content provider instead of querying the database directly is justified for
two reasons. First, a content provider is publicly accessible by all other applications in the
system. It is therefore perfectly possible for companies to write their own applications to
import data from other sources or to use the data for advanced customized analysis in
custom made applications. Secondly, although other applications can manipulate the data, it
can never be done directly. It can be done only using the content provider, offering control
of the data and ensuring no unauthorised actions on the database.
In the following paragraphs, the general implementation of a content provider in an Android
application is elaborated. After this, the implementation of both database designs developed
in Database design is explained.
5.4.3. Implementation of a content provider in Android
A content provider is created in the application by extending the abstract ContentProvider
class, which is part of the Android framework and needs to implement the onCreate, insert,
query, update and delete method of the superclass. A basic implementation using a content
provider in combination with a SQLite database is shown in Code snippet 2.
public class ChooseProvider extends ContentProvider { /* * Declaration and assignment of constants for database table names and columns */
/* * Declaration and assignment of Uris */ /* * Declaration and assignment of Uri codes */ ChooseDatabaseHelper chooseDatabaseHelper; SQLiteDatabase db; @Override public boolean onCreate() {} @Override
public Uri insert(Uri uri, ContentValues values) {} @Override
public Cursor query(Uri uri, String[] projection, String selection, String[] selectionArgs, String sortOrder) {}
@Override public int update(Uri uri, ContentValues values, String whereClause, String[] whereArgs) {}
@Override
Business architecture modelling in CHOOSE: a visual application for Android tablets 27
public int delete(Uri uri, String whereClause, String[] whereArgs) {} } private static class ChooseDatabaseHelper extends SQLiteOpenHelper {}
Code snippet 2: Implementation of a content provider
In the content provider, it is a good practice to declare the table names and column names
as constants, as they will be frequently used and hardcoded values are never a good option
during software development.
A concept used by the Android framework is that of the uniform resource identifier (URI). In
the context of a content provider, URI’s are used to identify the table which has to be used.
In the example used above with the database with one table, it is possible to define the URI
in Code snippet 3 to specify that table.
private static final String AUTHORITY = "com.test";
public static final Uri GOAL_URI = Uri.parse("content://" + AUTHORITY + "/" + “table”);
Code snippet 3: Defning URI's in the Android framework
Other applications can now use the URI “content://com.test.table” to access the data in the
table.
The complete implementation of the content provider for the database model based on the
CHOOSE metamodel can be found in appendix 1. The implementation of the database based
on the graph structure is available in appendix 2. In the next paragraph, a comparison of
both approaches and a conclusion is given.
5.4.4. Comparison of both implementations
When comparing the two approaches, it is clear that both have their advantages and
drawbacks. The graph database has the advantage of being able to represent each
metamodel consisting of entities with binary many-to-many relationships without having to
be changed. The design is simple and is fully able to store the same information as the
database based on the metamodel. Each entity has a unique id and in case extra information
about an entity or relationship needs to be stored only one database table needs to be
Business architecture modelling in CHOOSE: a visual application for Android tablets 28
adapted. The drawback of this design is that the types are not restricted to the ones in the
CHOOSE method although this can be enforced using additional CHECK SQL statements. The
database based on the metamodel is more robust and is more related to the CHOOSE
method.
Considering these arguments, both database models could be used in different settings. The
metamodel implementation is more suitable for an academic implementation while the
graph database model could be used in a professional environment. The second option is
faster and easier implemented while offering the same functionality.
During the further development of the application, the graph database model is used.
Changing between both database models is easy, as the only class in the application that has
to change is the ArchitectureData class which is the only class communicating with the
content provider. The graph database model was also able to store the changes that have
been made to the CHOOSE metamodel. An example of this is the performs relationship
which is shown in Figure 9. This relationship has changed to four different types of
relationships, based on the RACI-model.
5.5. Usability
5.5.1. User interface design
An important aspect to take into consideration during the development of a user interface
for mobile applications on Android are the Android design guidelines (Google 2013). These
guidelines are a series of best practices and are used by developers on a worldwide scale. It
makes the application more intuitive, as most developers implement them and users can
expect different applications to behave in the same way.
One example of the guidelines are the actions that happen when the user performs a
gesture. In Figure 16, the drag gesture is shown. A drag gesture is defined as a long press of
the user, followed by the user moving his finger across the screen (Google 2013). It is ended
by lifting the finger of the screen. Dragging is used to rearrange or moving data. Figure 17
Business architecture modelling in CHOOSE: a visual application for Android tablets 29
shows the zoom gesture, which means that the user touches the screen with two fingers,
after which they are put closer together or further from each other (Google 2013). The zoom
gesture is used to zoom in or out.
The Android design guidelines are constantly expanded and contain information about
styles, icons, colours, writing style, navigation within applications, compatibility between
screen sizes and much more. During the implementation of the tool, the design guidelines
available were followed.
Figure 16: The drag gesture (Google 2013)
Figure 17: The zoom gesture (Google 2013)
Business architecture modelling in CHOOSE: a visual application for Android tablets 30
Other aspects to take into account during the design are general usability guidelines. For the
implementation of a user-friendly design, each screen visible to the user has to have a clear
and distinct goal (Krug 2009). Therefore the business architecture modelling application will
consist of three screens. In the first screen, the edit screen, the user will be able to add,
modify or delete entities of the business architecture. In the second screen the user will be
able to change the visualisation. In the last screen, the business architecture can be
analysed.
5.5.2. Drawing of the graph on the screen
In the software, the business architecture is represented by a graph data structure. To
represent, manipulate and show the data, the classes shown in Figure 18 are used.
Figure 18: Class diagram of the core of the application
For a visual representation of a business architecture, one screen will not be large enough
unless only a part of the business architecture is shown. Therefore a scrollable pane was
developed on which users can scroll and zoom on an infinitely large two-dimensional surface
using their finger.
Business architecture modelling in CHOOSE: a visual application for Android tablets 31
The scrollable and zoomable pane is implemented by extending the View class available in
the Android framework. A view is a building block that can be placed on the screen. The class
is called InfiniteScrollView and is shown fully in Appendix 3.
The zooming feature is implemented by using the Android ScaleListener class that detects
zooming movements of the user. The scrolling feature is implemented manually and is
triggered when the user uses his finger on the screen as shown in Code snippet 4.
When the user touches the screen, the coordinates are saved. When the user moves his
finger, the total difference between the first coordinates and the coordinates his or her
finger is currently on is saved and the screen gets redrawn. This happens many times per
second to allow for a smooth scrolling experience. When the user lifts his finger, the new
coordinates are saved and used in the next scrolling gesture the user makes.
private void scroll(MotionEvent event) { int action = event.getAction(); switch (action) { case MotionEvent.ACTION_DOWN: touchStartPositionX = (Braun and Winter) event.getRawX(); touchStartPositionY = (Braun and Winter) event.getRawY(); break; case MotionEvent.ACTION_MOVE: totalOffsetX = (Braun and Winter) (savedTotalOffsetX + (((int) event.getRawX() - touchStartPositionX) / scaleFactor)); totalOffsetY = (Braun and Winter) (savedTotalOffsetY + (((int) event.getRawY() - touchStartPositionY) / scaleFactor)); this.invalidate(); break; case MotionEvent.ACTION_UP: case MotionEvent.ACTION_CANCEL: savedTotalOffsetX = totalOffsetX; savedTotalOffsetY = totalOffsetY; break; default: break; } }
Code snippet 4: Applying the scrolling on the screen
This InfiniteScrollView class is then further extended to implement specific behaviour. In the
edit screen, people need to be able to edit the architecture. For the edit screen this is
implemented in the EditArchitectureView class.
Business architecture modelling in CHOOSE: a visual application for Android tablets 32
To represent the business architecture in the application, a graph data structure is used
(Lafore and Waite 2003). The nodes of the graph are represented by objects of the Node
class, shown in Code snippet 5.
public class Node { protected int id; protected String name; protected String description; protected String type; public Node(int id, String name, String description, String type){ this.id = id; this.name = name; this.description = description; this.type = type; } public int getId() { return id; } public void setId(int id){ this.id = id; } public String getName() { return name; } public void setName(String name) { this.name = name; } public String getDescription() { return description; } public void setDescription(String description) { this.description = description; } public String getType() { return type; } public void setType(String type) { this.type = type; } }
Code snippet 5: The Node class
An edge or arc is represented by the Arc class and is shown in Code snippet 6. It contains two
Node objects and a type attribute.
public class Arc { protected Node fromNode; protected Node toNode; protected String type; public Arc(Node fromNode, Node toNode, String type) { this.fromNode = fromNode; this.toNode = toNode;
Business architecture modelling in CHOOSE: a visual application for Android tablets 33
this.type = type; } public Node getFromNode() { return fromNode; } public void setFromNode(Node fromNode) { this.fromNode = fromNode; } public Node getToNode() { return toNode; } public void setToNode(Node toNode) { this.toNode = toNode; } public String getType() { return type; } public void setType(String type) { this.type = type; } }
Code snippet 6: The Arc class
The complete graph is then represented by the Graph class. A Graph objects holds a list of
Nodes and Arcs as shown in Code snippet 7.
public class Graph { private List<Node> nodes = new ArrayList<Node>(); private List<Arc> arcs = new ArrayList<Arc>(); public List<Node> getNodes() { return nodes; } public Node getNode(int id){ return nodes.get(id); } public void addNode(Node node) { nodes.add(node); } public void addArc(DrawableArc drawableArc){ arcs.add(drawableArc); } public List<Arc> getArcs() { return arcs; } }
Code snippet 7: The Graph class
To be able to visualize this graph, the Strategy pattern is used (Freeman, Robson, Bates &
Sierra 2004). The strategy pattern is a software design pattern that allows to add different
behaviours to objects. The classic example is that of the implementation of a class
Business architecture modelling in CHOOSE: a visual application for Android tablets 34
representing a bird. The fly method in the class lets the bird fly, but what if the bird is a kiwi
or a penguin which are birds that cannot fly. The problem is solved by instead of directly
programming a fly method in the Bird class, a separate flying behaviour interface is created
which needs to be implemented by specific behaviours. The NodeDrawbehaviour interface is
shown in Code snippet 8. Depending on the type of a node, a different behaviour will have
to be added. In the case of nodes, four behaviour classes have to be implemented, a draw
behaviour for a goal, an operation, an object and an actor. An example of such an
implementation is the GoalDrawBehavior class. It shows the implementation of the drawing
behaviour of a goal. When the draw method is called, the coordinates of the corner points
are calculated and the shape is drawn. There are no images used for the drawing of the
business architecture. All shapes that are drawn on the screen are calculated coordinates.
The only image used is that of the logo and the icons in the menu. This causes the total size
of the application to be only 79 KB. An example of a drawn goal is shown in Figure 19.
public interface NodeDrawBehaviour { public void draw(Canvas canvas, Point position, String name); }
Code snippet 8: The NodeDrawBehavior interface
Business architecture modelling in CHOOSE: a visual application for Android tablets 35
Figure 19: Drawing of a goal node
In the same way, the relations between the different nodes are drawn by implementing the
ArcDrawbehaviour interface shown in Code snippet 9.
public interface ArcDrawBehaviour extends Clickable { void draw(Canvas canvas, DrawableNode fromNode, DrawableNode toNode); }
Code snippet 9: The ArcDrawBehaviour interface
The implementation of the drawing behavior of an arc is more difficult than it is for a node.
An example of such an arc drawing behaviour implementation can be found in Appendix 4. It
shows the implementation of a composition relationship between two objects. To draw this
relationship, several steps have to be taken.
First of all, the line between both objects is drawn by using both centre coordinates of the
objects. The line has to stop in the diamond that represents the composition relationship.
Therefore, the intersection point between the line and the object is computed by calculating
the four possible intersection points between the line segments forming the object and the
line connecting both objects. This is done by using the denominator approach shown in Code
Business architecture modelling in CHOOSE: a visual application for Android tablets 36
snippet 10. The input are four points, each consisting of an x and y coordinate. Point a and b
form the first line segment, point c and d form the second.
public static Point intersectionPointOfLineSegments(Point a, Point b, Point c, Point d){ Point intersectionPoint = new Point(); double denominator = (d.y-c.y)*(b.x-a.x)-(d.x-c.x)*(b.y-a.y); if (denominator == 0){ return null; } double u1 = ((d.x-c.x)*(a.y-c.y)-(d.y-c.y)*(a.x-c.x))/denominator; double u2 = ((b.x-a.x)*(a.y-c.y)-(b.y-a.y)*(a.x-c.x))/denominator; if (u1 == u2){ return null; } if (u1 > 0 && u1 < 1 && u2 > 0 && u2 < 1){ intersectionPoint.x = (a.x + u1*(b.x-a.x)); intersectionPoint.y = (a.y + u1*(b.y-a.y)); return intersectionPoint; } return null; }
Code snippet 10: Calculating an intersection between two line segments
After the four possible intersection points are calculated, the closest one is determined by
comparing the distances using the Pythagorean theorem. Using this intersection point, the
coordinates of the line segment are calculated.
After the line is drawn, the diamond representing the composition relationship is drawn. To
do this, the coordinates of the corner points of the diamond with the tip in the intersection
point are calculated. Using the inverse tangent of the angle of the line segment between the
objects and the position between them, a transformation matrix which rotates the
coordinates is formed and the correct coordinates are calculated. After this, the
InfiniteScrollView class applies additional transformation matrices applying the zooming and
scrolling actions of the user. The result of these calculations is shown in Figure 20. By
executing the draw method of all nodes and objects on the InfiniteScrollView, the complete
graph is drawn on the screen.
Business architecture modelling in CHOOSE: a visual application for Android tablets 37
Figure 20: Drawing of a composition relationship between two objects
5.5.3. Automatically drawing the architecture
During the creation of the architecture, the user can let the application draw the
architecture. This happens using a force-directed algorithm (Battista, Eade, Tamassia & Tollis
1998) around the centre coordinates of the plane. In its most rudimentary form, all vertex
objects in the graph are modelled as point charges which are all exerting a repelling force on
each other. The arcs are modelled as springs with a certain length. Letting the system react
by computing the exerted forces and moving the vertices accordingly leads to a state with at
least a local minimum in kinetic energy and an equilibrium in the whole system. The benefits
of this algorithm is the flexibility. It allows for users to place certain vertices on fixed
positions and additional positioning rules can easily be enforced. The downside is the fact
that the global optimum is not guaranteed. The implementation of this algorithm is shown in
Appendix 5.
Business architecture modelling in CHOOSE: a visual application for Android tablets 38
5.5.4. Conclusion
The past paragraphs show how the visual implementation of the business architecture in the
application is done. This approach can be applied to every object-oriented programming
language. The implementation of the user interface is more specific to the Android
framework and is not further elaborated in this text but can be found in de source code
available on the CD in Appendix 6.
Use of the tool 6.
The tool is designed to be used on Android tablets but can run on every Android device
running version 4.0 or higher. It consists of three main panels which can be accessed through
a tab interface. In the edit panel, users can create and edit their architecture. The view panel
serves for users to adjust the visualization of the architecture. The last panel is the analyse
panel and delivers useful output using the earlier created architecture. These three panels
are now discussed more in detail.
6.1. Edit
The users are welcomed in the edit tab, in which the architecture can be created and edited.
In this screen, users can add, delete and change entities and relationships of the
architecture. When a new architecture is created, the screen is completely empty. To create
a new entity, users need to press on an empty point on the plane. This plane is scrollable by
swiping a finger across the screen and zooming is done by making a pinching gesture. These
gestures are following the Android design guidelines (Google 2013). Users are then
subsequently asked which type of entity they want to add, which name it needs to have and
an optional description can be given. This process is done in multiple dialogs, which makes
the action to complete more intuitive and clear to the user (Krug 2009). The entity is then
placed where the user originally pressed.
In this example a small tire company that has to make sure customers leave safely with the
proper tire pressure is modelled. An important object in this company is obviously a tire. The
Business architecture modelling in CHOOSE: a visual application for Android tablets 39
process of creating a tire object is illustrated in Figure 21 and Figure 22. In the last
screenshot four more related objects are created.
Figure 21: Creating entities dialog
Business architecture modelling in CHOOSE: a visual application for Android tablets 40
Changing the properties of an entity can be done by pressing on it in the edit panel, after
which a dialog appears. In this dialog it is possible to change the name of the entity as well as
the description. It also offers one of the two ways to create a relationship between different
entities. Typing in the “Create relationship with” textbox lets the autocomplete feature look
for matching entities which are then suggested. If the relationship type is required, a dialog
will ask which type it is.
The second way in which a relationship can be created is by long pressing on an entity. The
user hears a click sound and the device will vibrate, which means it is now possible to draw a
relationship between two entities. This is a fast way to model small parts of the EA.
In the car tire centre example, there exists a composition relationship between the car and
the engine and also between the car and the wiper. A specialisation relationship exists
between the car and the vehicle entity and there is also an aggregation relationship between
the car and the tire. The change dialog and the creation of the relationships is shown in
Figure 23. The relationship between the car and the wiper is purposely created in the wrong
direction.
Figure 6: Creation of entities Figure 22: Creation of entities
Business architecture modelling in CHOOSE: a visual application for Android tablets 41
Relationships should always be drawn or created from the least abstract entity towards the
most abstract entity. This means that a link between two processes should always start at
the sub process in order to be semantically and syntactically correct. In the same way, the
relationship between two goals should start from the lower-level goal towards the higher-
level goal. The same principle holds for actors, where one should always start with the
subordinate in the relationship. The most complex relationships exist between objects. In
the example of the tire centre, the specialisation relationship should be drawn from the car
towards the vehicle, as this is the more abstract entity. In the case of the tire it should be
drawn from the tire towards the car as the car in this relationship is the more abstract or
higher-level entity.
Business architecture modelling in CHOOSE: a visual application for Android tablets 42
Figure 23: Changing entities and creating relationships
Business architecture modelling in CHOOSE: a visual application for Android tablets 43
The created relationships can also be deleted and reversed by pressing on a relationship.
This is illustrated in Figure 24.
For both small and large architectures, the automatic arranging of the architecture creates
an aesthetically pleasing structure. It must be noted that for larger architectures there is the
possibility of a loss of overview on the user’s side as entities will be relocated. The fixation of
certain vertices can help to prevent this. The process for a simple graph and a more complex
graph is shown in Figure 25Figure 25. The more complex example graph is still a planar
graph, having no intersecting arcs, which explains the good looking result. During the case
study it was clear that the overview is lost very quickly even with the automatic positioning
due to the non-planarity of the generated graphs representing the architecture. This
problem is tackled by letting users select and isolate entities on which they can work
separately in the edit tab. In this way, the user will never have to deal with large
unmaintainable structures. It is in this situation that the method to add relationships by
typing is the most useful as a lot of entities will not be reachable on the screen.
Figure 24: Changing relationships
Business architecture modelling in CHOOSE: a visual application for Android tablets 44
In the tire company example, a few more entities are added such as the safety goal, the
customer actor, the process of driving a car and others. We will isolate the objects to work
on them independently. The isolation happens in the view tab and is shown in Figure 26.
Business architecture modelling in CHOOSE: a visual application for Android tablets 45
Figure 25: Automatic drawing of the architecture
Business architecture modelling in CHOOSE: a visual application for Android tablets 46
Figure 26: Isolation of parts of the architecture and changing the visualization
Business architecture modelling in CHOOSE: a visual application for Android tablets 47
6.2. View
An important contribution of the IEEE Standard 1471-2000 next to the provision of
definitions for architecture is the distinction between a view and a viewpoint (IEEE Computer
Society 2000). An implementation of this can be found in the view panel.
The view panel allows for multiple viewpoints to be selected. Several viewpoints isolate
specific parts of the EA. The goal viewpoint isolates all goals, allowing the generation of a
goal tree. The operation viewpoint isolates all processes and projects while the operation
flow also adds the objects to show possible streams of objects throughout the operations.
The other viewpoints are similar. The view panel is shown in Figure 27 while the zooming
function is shown in Figure 28.
Figure 27: The view panel
Business architecture modelling in CHOOSE: a visual application for Android tablets 48
Figure 28: Zooming
6.3. Analyse
The analyse tab is designed to create output for the user. It shows the user a RACI chart by
using the information of the relationships between the operations and actors. It is shown in
Figure 29.
Business architecture modelling in CHOOSE: a visual application for Android tablets 49
Figure 29: RACI chart
Testing: Case studies 7.
7.1. First case-study: Cavalier
During a first case study at Cavalier in Eeklo, the application was tested by creating the
business architecture which was described on the screen. It was clear that after the creation
of just a dozen entities, the overview is lost easily. Very soon, when modelling at an average
speed, the architecture becomes a web of entities between which the relationships and the
complete structure are no longer clear. This was the incentive for the separate views to be
created so that users could work on parts of the architecture. The case study was also the
incentive for the as-is/to-be analysis and the RACI chart.
The results of the adaptations allowed for fast entry of the architecture and let the user
make an abstraction of parts of the architecture that are already modelled.
Business architecture modelling in CHOOSE: a visual application for Android tablets 50
7.2. Second case-study: TopGlass
The second case study at TopGlass in Torhout was designed to test the usability of the
application. For two hours, the application was used and the case-study led to several useful
conclusions.
Although the application is made according to the Android design guidelines, it is not
completely intuitive what actions the user can trigger. A tutorial when the application is
started for the first time is therefore necessary. This is especially true for users which are not
used to using Android tablets or tablets in general.
For users to independently create their business architecture, it is necessary that they have
an insight in how the CHOOSE model works. When the application is started for the first
time, a tutorial explaining the CHOOSE model would be very useful.
Once the user knows how the program works, the business architecture is created without
much effort. The creation of entities and relationships goes fast and the user is restricted by
his mental ability to create the architecture instead of the software. From this perspective,
the implementation of the visual approach was a success.
Conclusion 8.
8.1. General conclusion
This masters dissertation shows the development of a software implementation for the
creation of a business architecture using the CHOOSE metamodel.
The CHOOSE metamodel consists of four different types of entities, which are goals, actors,
operations and objects. The business is modelled using these four entities and by modelling
the relationships between them. The theoretical background made clear that SMEs do have
Business architecture modelling in CHOOSE: a visual application for Android tablets 51
a need for such a tool, given their specific nature, technological advances and the
competitive environment they live in.
Two important aspects of the development of the application were the implementation of
the data manipulation and the development of the visual and user-friendly interface.
We looked at two different but interchangeable data models that can be implemented for
the application. The first data model is based directly on the CHOOSE metamodel and is
more suited for academic purpose. The second data model is based on a graph data
structure. The latter option is easier and faster to implement and also broader applicable.
The drawback of this model is that the data integrity is not enforced by the data model.
Therefore this model is more suitable for a professional context.
The second important aspect of the tool is the usability and intuitiveness, as small business
owners spend a lot of time managing the day to day operations of their business, having
little time left for strategic issues. A general method for the visualization of structures
consisting of entities and relationships between them is proposed.
8.2. Limitations and recommendations for further research
The case-studies that were executed at Cavalier and TopGlass revealed several bugs in the
software and potential issues that have been resolved. These case-studies have shown that
it is necessary for the application to have tutorials shown when the user starts the
application for the first time. Both the CHOOSE metamodel and the features of the
application need such a tutorial. When the application is further developed, this must be a
top priority.
A second thing to take into account is that the application data model is based on an older
version of the CHOOSE metamodel. Both data models allow for the CHOOSE complete or
essential metamodel to be modelled. For a correct representation of the business
architecture in CHOOSE, this implementation is necessary.
Business architecture modelling in CHOOSE: a visual application for Android tablets 52
The application has been tested on three different Android tablets and numerous emulators.
It is very difficult to test the whole range of Android tablets, but there is one error that came
up on one tablet while the application worked perfectly on the other. When touching the
screen on a Samsung Galaxy tab 10.1, the coordinates of where the user clicks is calculated
wrongly, causing a constant shift in where the user touches the screen. This issue needs to
be addressed so that the software runs smoothly on all Android tablets available.
Another limitation of the application is that it is only available for the Android operating
system. The software architecture for the visualization is made in such a way that it can be
transferred easily across platforms. With the rise of web applications, a solution which is
broader applicable could be the development of a web application using HTML 5 in
combination with the jQuery javascript library. These technologies have the potential to
create an application accessible from every device running a browser. It also would make the
transfer between different platforms easier as users can access their architecture
everywhere.
An important aspect in the application that needs attention is the analysis phase. Given the
graph structure used in the application, it enables the implementation of graph algorithms
on the business architecture.
Business architecture modelling in CHOOSE: a visual application for Android tablets 53
References
Aarabi, M., Saman, M. Z. M., Wong, K. Y., Beheshti, H. M. & Hemdi, A. R. (2011). The Effect of
Enterprise Architecture for Enterprise Resource Planning in Small and Medium Enterprises: a
Review and Research Direction. IESS: Indonesia, 159-163.
Balabko, P. & Wegmann, A. (2006). Systemic classification of concern-based design
methods in the context of enterprise architecture. Inf Syst Front, 8(2), 115-131.
Basole, R. C. (2007). The emergence of the mobile enterprise: A value-driven perspective.
Management of Mobile Business. ICMB 2007. International Conference on the IEEE.
Battista, G. D., Eades P., Tamassia R. & Tollis I. G. (1998). Graph drawing: algorithms for the
visualization of graphs, Prentice Hall PTR.
Bernaert, M. & Poels G. (2011). The quest for know-how, know-why, know-what and know-
who: using KAOS for enterprise modelling. In CAiSE International Workshops, 83, 29-40,
LNBIP: Springer.
Bernaert, M., Poels G., Snoeck M. & De Backer M. (2013). CHOOSE : Towards a Metamodel
for Enterprise Architecture in Small and Medium-Sized Enterprises.
Bernaert, M., G. Poels, Snoeck M. & De Backer M. (2013). Enterprise Architecture for Small
and Medium-Sized Enterprises: A Starting Point for Bringing EA to SMEs, Based on Adoption
Models. In: Devos J, Van Landeghem H, Deschoolmeester D (eds) Information systems and
small and medium-sized enterprises (SMEs) : state of art of IS research in SMEs.
Braun, C. & Winter R. (2005). A comprehensive enterprise architecture metamodel and its
implementation using a metamodeling platform. Desel, Jörg; Frank, Ulrich: 24-25.
Daneva, M. & van Eck, P. (2007). What Enterprise Architecture and Enterprise Systems Usage
Can and Can not Tell about Each Other. Int J Comput Sci Appl, 4, 93 - 109.
Freeman, E., Robson E., Bates B. & Sierra K. (2004). Head first design patterns, O'Reilly
Media, Incorporated.
Business architecture modelling in CHOOSE: a visual application for Android tablets 54
Google. (2013). Gestures. Retrieved 10 February 2013, available on
<http://developer.android.com/design/patterns/gestures.html>.
Google. (2013). Platform Versions. Retrieved 1 May 2013, available on
<http://developer.android.com/about/dashboards/index.html#Platform>.
Henderson, J., & Venkatraman, N. (1993). Strategic Alignment: Leveraging Information
Techonology For Transforming Organizations. IBM Systems Journal, 32.
IBM.(2013). Rational System Architect. Retrieved 10 February 2013, available on
<http://www-01.ibm.com/software/awdtools/systemarchitect/>.
Jacobs, D., Kotzé P., Merwe A. & Gerber A. (2011). Enterprise architecture for small and
medium enterprise growth. Advances in Enterprise Engineering. 61-75.
Johnson, P., Johansson E., Sommestad T. & Ullberg J. (2007). A tool for enterprise
architecture analysis. Enterprise Distributed Object Computing Conference. EDOC 2007. 11th
IEEE International, IEEE.
Jonkers, H., Lankhorst M., ter Doest H. W., Arbab F., Bosma H. & Wieringa R. J. (2006).
Enterprise architecture: Management tool and blueprint for the organisation. Information
Systems Frontiers. 8(2): 63-66.
Jonkers, H., Proper, E. & Turner, M. (2009). TOGAF and Archimate: A future together. The
Open Group.
Jonkers, H., Proper, E. & Turner, M. (2009). TOGAF 9 and Archimate 1.0. The Open Group.
Krug, S. (2009). Don't make me think! : a common sense approach to Web usability. Berkeley,
Calif, New Riders Pub.
Lafore, R. & Waite, M. (2003). Data structures & algorithms in Java, Sams.
Lankhorst, M. (2009). Enterprise architecture at work: Modelling, communication and
analysis, Springer.
Business architecture modelling in CHOOSE: a visual application for Android tablets 55
Lindström, A., Johnson, P., Johansson, E., Ekstedt, M., & Simonsson, M. (2006). A survey on
CIO concerns-do enterprise architecture frameworks support them? Inf Syst Front, 8(2), 81-
90.
Maes R., (2007) An Integrative Perspective on Information Management. PrimaVera Working
Paper 2007-09, Universiteit van Amsterdam.
McConnell, S. (2004). Code complete, Microsoft press.
Public law. (1996). Clinger-Cohen Act. 104th Congress, 110 Stat. 186 Public Law 104–106—
Feb. 10, 1996.
Radeke, F. (2011) Toward Understanding Enterprise Architecture Management's Role in
Strategic Change: Antecedents, Processes, Outcomes. In WI,(Vol. 2011).
Sessions, R. (2012). A fundamental metric for predicting IT success. Retrieved on 1 April
2013, available on <http://www.objectwatch.com/white_papers.htm >.
Sessions, R. (2007). A comparison of the top four enterprise-architecture methodologies.
Retrieved on 1 May 2013, available on <http://www.objectwatch.com/white_papers.htm>
466232(May): 1-28.
Schekkerman, J. (2005). Trends in enterprise architecture 2005: How are organizations
progressing. Institute for Enterprise Architecture Developments, Amersfoort. Retrieved on 6
May 2013. Available on < http://www.enterprise-architecture.info/Images/EA%20Survey/
Enterprise%20Architecture%20Survey%202005%20IFEAD%20v10.pdf> .
Society, I. C. (2000). Ieee-std-1471-2000 recommended practice for architectural description
of software-intensive systems. IEEE.
SoftwareAG. Software AG- ARIS Platform. Retrieved on 28 March 2013, available on
<http://www.softwareag.com/corporate/products/aris_platform/default.asp>.
SQLite. (2013). SQLite: small. Fast. Reliable. Choose any three. Retrieved on 28 March 2013.
Available on <http://www.sqlite.org>.
Business architecture modelling in CHOOSE: a visual application for Android tablets 56
Tamm, T., Seddon, P. B., Shanks, G. & Reynolds, P. (2011). How Does Enterprise Architecture
Add Value to Organisations?. CAIS, 28(1).
Urbaczewski, L. & Mrdalj, S. (2006). A comparison of enterprise architecture frameworks.
Issues in Information Systems: Eastern Michigan University. VII. No2.
Van Dullemen, J., Vermeulen, E., Morssink, P. J., Lendvai, R. & van der Zee, H. (2008).
Enterprise Architectuur: Een managementinstrument voor business transformatie. Retrieved
on 6 May 2013 available on <http://www.be.atosconsulting.com/NR/rdonlyres/0E873E92-
47C0-49EC-882F-4F384B6A6939/0/AtosConsulting_Whitepaper_Enterprise_
Architecture_nl.pdf>.
Van Sante, T., Kemmeren, J., Rouw, E., Kerssens, D. & van den Bent H. (2007). Togaf the
Open Group Architectural Framework: A Management Guide. Van Haren Publishing.
Zachman, J. (1996). The framework for enterprise architecture: Background, Description and
Utility, Zachman International.
Business architecture modelling in CHOOSE: a visual application for Android tablets 57
Appendices
Appendix 1: ChooseProvider implementation
package data; import java.util.HashMap; import java.util.Map; import android.content.ContentProvider; import android.content.ContentValues; import android.content.Context; import android.content.UriMatcher; import android.database.Cursor; import android.database.SQLException; import android.database.sqlite.SQLiteDatabase; import android.database.sqlite.SQLiteOpenHelper; import android.database.sqlite.SQLiteQueryBuilder; import android.net.Uri; public class ChooseProvider extends ContentProvider { /* * Declaration and assignment of constants for Goal, Actor, Operation and Object database tables and columns */ private static final String GOAL_TABLE = "Goal"; private static final String GOAL_ID = "_id"; public static final String GOAL_NAME = "name"; public static final String GOAL_DESCRIPTION = "description"; private static final String ACTOR_TABLE = "Actor"; private static final String ACTOR_ID = "_id"; public static final String ACTOR_NAME = "name"; public static final String ACTOR_DESCRIPTION = "description"; private static final String OPERATION_TABLE = "Operation"; private static final String OPERATION_ID = "_id"; public static final String OPERATION_NAME = "name"; public static final String OPERATION_DESCRIPTION = "description"; private static final String OBJECT_TABLE = "Object"; private static final String OBJECT_ID = "_id"; public static final String OBJECT_NAME = "name"; public static final String OBJECT_DESCRIPTION = "description"; /* * Declaration and assignment of constants for many-to-many relationship tables between Goal, Actor, Operation and Object */ private static final String RESPONSIBILITY_TABLE = "Responsibility"; private static final String PERFORMS_TABLE = "Performs"; private static final String BELONGSTO_TABLE = "BelongsTo"; private static final String SERVES_TABLE = "Serves"; private static final String INPUT_TABLE = "Input"; private static final String OUTPUT_TABLE = "Output"; private static final String CONCERNS_TABLE = "Concerns"; /* * Declaration and assignment of recursive relation tables and columns for Goal, Actor and Operation */ private static final String OR_REFINEMENT_TABLE = "OrRefinement"; public static final String GOAL_OR_REFINEMENT_HIGHER_LEVEL = "higherLevelGoal"; public static final String GOAL_OR_REFINEMENT_LOWER_LEVEL = "lowerLevelGoal"; private static final String AND_REFINEMENT_TABLE = "AndRefinement"; public static final String GOAL_AND_REFINEMENT_HIGHER_LEVEL = "higherLevelGoal"; public static final String GOAL_AND_REFINEMENT_LOWER_LEVEL = "lowerLevelGoal";
Business architecture modelling in CHOOSE: a visual application for Android tablets 58
private static final String SUPERVISION_TABLE = "Supervision"; public static final String ACTOR_SUPERVISION_SUPERVISOR = "supervisor"; public static final String ACTOR_SUPERVISION_SUPERVISEE = "supervisee"; private static final String AGGREGATION_TABLE = "Aggregation"; public static final String OBJECT_AGGREGATION_WHOLE = "whole"; public static final String OBJECT_AGGREGATION_PART = "part"; private static final String SPECIALISATION_TABLE = "Specialisation"; public static final String OBJECT_SPECIALISATION_IS_A = "isA"; public static final String OBJECT_SPECIALISATION_SPECIALISED = "specialised"; private static final String ASSOCIATION_TABLE = "Association"; public static final String OBJECT_ASSOCIATION_OBJECT1 = "object1"; public static final String OBJECT_ASSOCIATION_OBJECT2 = "object2"; private static final String COMPOSITION_TABLE = "Composition"; public static final String OBJECT_COMPOSITION_WHOLE = "whole"; public static final String OBJECT_COMPOSITION_PART = "part"; /* * Declaration and assignment of Uris */ private static final String AUTHORITY = "com.choosebusinessarchitecture"; public static final Uri GOAL_URI = Uri.parse("content://" + AUTHORITY + "/" + GOAL_TABLE); public static final Uri ACTOR_URI = Uri.parse("content://" + AUTHORITY + "/" + ACTOR_TABLE); public static final Uri OPERATION_URI = Uri.parse("content://" + AUTHORITY + "/" + OPERATION_TABLE); public static final Uri OBJECT_URI = Uri.parse("content://" + AUTHORITY + "/" + OBJECT_TABLE); public static final Uri RESPONSIBILITY_URI = Uri.parse("content://" + AUTHORITY + "/" + RESPONSIBILITY_TABLE); public static final Uri PERFORMS_URI = Uri.parse("content://" + AUTHORITY + "/" + PERFORMS_TABLE); public static final Uri BELONGSTO_URI = Uri.parse("content://" + AUTHORITY + "/" + BELONGSTO_TABLE); public static final Uri SERVES_URI = Uri.parse("content://" + AUTHORITY + "/" + SERVES_TABLE); public static final Uri INPUT_URI = Uri.parse("content://" + AUTHORITY + "/" + INPUT_TABLE); public static final Uri OUTPUT_URI = Uri.parse("content://" + AUTHORITY + "/" + OUTPUT_TABLE); public static final Uri CONCERNS_URI = Uri.parse("content://" + AUTHORITY + "/" + CONCERNS_TABLE); public static final Uri OR_REFINEMENT_URI = Uri.parse("content://" + AUTHORITY + "/" + OR_REFINEMENT_TABLE); public static final Uri AND_REFINEMENT_URI = Uri.parse("content://" + AUTHORITY + "/" + AND_REFINEMENT_TABLE); public static final Uri SUPERVISION_URI = Uri.parse("content://" + AUTHORITY + "/" + SUPERVISION_TABLE); public static final Uri AGGREGATION_URI = Uri.parse("content://" + AUTHORITY + "/" + AGGREGATION_TABLE); public static final Uri SPECIALISATION_URI = Uri.parse("content://" + AUTHORITY + "/" + SPECIALISATION_TABLE); public static final Uri ASSOCIATION_URI = Uri.parse("content://" + AUTHORITY + "/" + ASSOCIATION_TABLE); public static final Uri COMPOSITION_URI = Uri.parse("content://" + AUTHORITY + "/" + COMPOSITION_TABLE); /* * Declaration and assignment of Uri codes */ public static final int GOAL = 100; public static final int ACTOR = 200; public static final int OPERATION = 300; public static final int OBJECT = 400; public static final int RESPONSIBILITY = 500; public static final int PERFORMS = 510; public static final int BELONGSTO = 520; public static final int SERVES = 530; public static final int INPUT = 540; public static final int OUTPUT = 550; public static final int CONCERNS = 560;
Business architecture modelling in CHOOSE: a visual application for Android tablets 59
public static final int OR_REFINEMENT = 600; public static final int AND_REFINEMENT = 610; public static final int SUPERVISION = 620; public static final int AGGREGATION = 630; public static final int SPECIALISATION = 640; public static final int ASSOCIATION = 650; public static final int COMPOSITION = 660; /* * Links the codes with the associated table */ private Map<Integer, String> tables = new HashMap<Integer, String>(); ChooseDatabaseHelper chooseDatabaseHelper; SQLiteDatabase db; int uriType; @Override public boolean onCreate() { chooseDatabaseHelper = new ChooseDatabaseHelper(getContext()); assignTables(); return false; } private void assignTables() { tables.put(GOAL, GOAL_TABLE); tables.put(ACTOR, ACTOR_TABLE); tables.put(OPERATION, OPERATION_TABLE); tables.put(OBJECT, OBJECT_TABLE); tables.put(RESPONSIBILITY, RESPONSIBILITY_TABLE); tables.put(PERFORMS, PERFORMS_TABLE); tables.put(BELONGSTO, BELONGSTO_TABLE); tables.put(SERVES, SERVES_TABLE); tables.put(INPUT, INPUT_TABLE); tables.put(OUTPUT, OUTPUT_TABLE); tables.put(CONCERNS, CONCERNS_TABLE); tables.put(OR_REFINEMENT, OR_REFINEMENT_TABLE); tables.put(AND_REFINEMENT, AND_REFINEMENT_TABLE); tables.put(SUPERVISION, SUPERVISION_TABLE); tables.put(AGGREGATION, AGGREGATION_TABLE); tables.put(SPECIALISATION, SPECIALISATION_TABLE); tables.put(ASSOCIATION, ASSOCIATION_TABLE); tables.put(COMPOSITION, COMPOSITION_TABLE); } @Override public Uri insert(Uri uri, ContentValues values) { String table = getTable(uri); db = chooseDatabaseHelper.getWritableDatabase(); db.insert(table, "null", values); return null; } @Override public Cursor query(Uri uri, String[] projection, String selection, String[] selectionArgs, String sortOrder) { String table = getTable(uri); db = chooseDatabaseHelper.getReadableDatabase(); SQLiteQueryBuilder queryBuilder = new SQLiteQueryBuilder(); queryBuilder.setTables(table); Cursor cursor = queryBuilder.query(db, projection, selection, selectionArgs, null, null, sortOrder); cursor.setNotificationUri(getContext().getContentResolver(), uri); return cursor; }
Business architecture modelling in CHOOSE: a visual application for Android tablets 60
@Override public int update(Uri uri, ContentValues values, String whereClause, String[] whereArgs) { String table = getTable(uri); db = chooseDatabaseHelper.getWritableDatabase(); int affectedRows = db.update(table, values, whereClause, whereArgs); return affectedRows; } @Override public int delete(Uri uri, String whereClause, String[] whereArgs) { String table = getTable(uri); int affectedRows = 0; db = chooseDatabaseHelper.getWritableDatabase(); affectedRows = db.delete(table, whereClause, whereArgs); return affectedRows; } @Override public String getType(Uri uri) { return null; } private static final UriMatcher sURIMatcher = new UriMatcher(UriMatcher.NO_MATCH); static { sURIMatcher.addURI(AUTHORITY, GOAL_TABLE, GOAL); sURIMatcher.addURI(AUTHORITY, ACTOR_TABLE, ACTOR); sURIMatcher.addURI(AUTHORITY, OPERATION_TABLE, OPERATION); sURIMatcher.addURI(AUTHORITY, OBJECT_TABLE, OBJECT); sURIMatcher.addURI(AUTHORITY, RESPONSIBILITY_TABLE, RESPONSIBILITY); sURIMatcher.addURI(AUTHORITY, PERFORMS_TABLE, PERFORMS); sURIMatcher.addURI(AUTHORITY, BELONGSTO_TABLE, BELONGSTO); sURIMatcher.addURI(AUTHORITY, SERVES_TABLE, SERVES); sURIMatcher.addURI(AUTHORITY, INPUT_TABLE, INPUT); sURIMatcher.addURI(AUTHORITY, OUTPUT_TABLE, OUTPUT); sURIMatcher.addURI(AUTHORITY, CONCERNS_TABLE, CONCERNS); sURIMatcher.addURI(AUTHORITY, OR_REFINEMENT_TABLE, OR_REFINEMENT); sURIMatcher.addURI(AUTHORITY, AND_REFINEMENT_TABLE, AND_REFINEMENT); sURIMatcher.addURI(AUTHORITY, SUPERVISION_TABLE, SUPERVISION); sURIMatcher.addURI(AUTHORITY, AGGREGATION_TABLE, AGGREGATION); sURIMatcher.addURI(AUTHORITY, SPECIALISATION_TABLE, SPECIALISATION); sURIMatcher.addURI(AUTHORITY, ASSOCIATION_TABLE, ASSOCIATION); sURIMatcher.addURI(AUTHORITY, COMPOSITION_TABLE, COMPOSITION); } private String getTable(Uri uri) { uriType = sURIMatcher.match(uri); if (uriType == -1){ throw new IllegalArgumentException("Unknown URI (uriMatcher cannot find URI) " + uri); } String table = tables.get(uriType); if (table.equals(null)) { throw new IllegalArgumentException("Unknown URI (no implementetion for the operation for this URI)"); } return table; } private static class ChooseDatabaseHelper extends SQLiteOpenHelper { /* * Declaration and assignment of database properties */ private static final String DATABASE_NAME = "ChooseDatabase"; private static final int DATABASE_VERSION = 1;
Business architecture modelling in CHOOSE: a visual application for Android tablets 61
ChooseDatabaseHelper(Context context) { super(context, DATABASE_NAME, null, DATABASE_VERSION); } @Override public void onCreate(SQLiteDatabase db) { /* * Declaration and assignment of SQL queries for the creation of the Goal, Actor, Operation and Object table */ final String CREATE_GOAL_TABLE = "CREATE TABLE IF NOT EXISTS " + GOAL_TABLE + "(" + GOAL_ID + " INTEGER PRIMARY KEY ASC" + ", " + GOAL_NAME + " TEXT" + ", " + GOAL_DESCRIPTION + " TEXT" + ");";
final String CREATE_ACTOR_TABLE = "CREATE TABLE IF NOT EXISTS " + ACTOR_TABLE + "(" + ACTOR_ID + " INTEGER PRIMARY KEY ASC" + ", " + ACTOR_NAME + " TEXT" + ", " +
ACTOR_DESCRIPTION + " TEXT" + ");";
final String CREATE_OPERATION_TABLE = "CREATE TABLE IF NOT EXISTS " + OPERATION_TABLE + "(" + OPERATION_ID + " INTEGER PRIMARY KEY ASC" + ", " + OPERATION_NAME + " TEXT" + ", " + OPERATION_DESCRIPTION + " TEXT" + ");";
final String CREATE_OBJECT_TABLE = "CREATE TABLE IF NOT EXISTS " + OBJECT_TABLE + "(" + OBJECT_ID + " INTEGER PRIMARY KEY ASC" + ", " +
OBJECT_NAME + " TEXT" + ", " + OBJECT_DESCRIPTION + " TEXT" + ");"; /* * Declaration and assignment of SQL queries for the creation of the many-to-many relationship tables between Goal, Actor, Operation and Object
final String REFERENCE_ACTOR = " REFERENCES " + ACTOR_TABLE + "(" + ACTOR_ID + ")"; final String REFERENCE_GOAL = " REFERENCES " + GOAL_TABLE + "(" + GOAL_ID + ")"; final String REFERENCE_OPERATION = " REFERENCES " + OPERATION_TABLE + "(" + OPERATION_ID + ")"; final String REFERENCE_OBJECT = " REFERENCES " + OBJECT_TABLE + "(" + OBJECT_ID + ")"; final String ACTOR_FOREIGN_KEY = "FOREIGN KEY (" + ACTOR_TABLE + ")" + REFERENCE_ACTOR; final String GOAL_FOREIGN_KEY = "FOREIGN KEY (" + GOAL_TABLE + ")" + REFERENCE_GOAL;
final String OPERATION_FOREIGN_KEY = "FOREIGN KEY (" + OPERATION_TABLE + ")" + REFERENCE_OPERATION; final String OBJECT_FOREIGN_KEY = "FOREIGN KEY (" + OBJECT_TABLE + ")" + REFERENCE_OBJECT; final String CREATE_RESPONSIBILITY_TABLE ="CREATE TABLE IF NOT EXISTS " + RESPONSIBILITY_TABLE + " (" + ACTOR_TABLE + " INTEGER" + ", " + GOAL_TABLE + " INTEGER" + ", " + ACTOR_FOREIGN_KEY + ", " + GOAL_FOREIGN_KEY + ");"; final String CREATE_PERFORMS_TABLE ="CREATE TABLE IF NOT EXISTS " + PERFORMS_TABLE + " (" + ACTOR_TABLE + " INTEGER" + ", " + OPERATION_TABLE + " INTEGER" + ", " + ACTOR_FOREIGN_KEY + ", " + OPERATION_FOREIGN_KEY + ");"; final String CREATE_BELONGSTO_TABLE ="CREATE TABLE IF NOT EXISTS " + BELONGSTO_TABLE + " (" + ACTOR_TABLE + " INTEGER" + ", " + OBJECT_TABLE + " INTEGER" + ", " + ACTOR_FOREIGN_KEY + ", " + OBJECT_FOREIGN_KEY + ");"; final String CREATE_SERVES_TABLE = "CREATE TABLE IF NOT EXISTS " + SERVES_TABLE + " (" + OPERATION_TABLE + " INTEGER" + ", " + GOAL_TABLE + " INTEGER" + ", " + OPERATION_FOREIGN_KEY + ", " + GOAL_FOREIGN_KEY + ");"; final String CREATE_INPUT_TABLE = "CREATE TABLE IF NOT EXISTS " + INPUT_TABLE + " (" +
Business architecture modelling in CHOOSE: a visual application for Android tablets 62
OPERATION_TABLE + " INTEGER" + ", " + OBJECT_TABLE + " INTEGER" + ", " + OPERATION_FOREIGN_KEY + ", " + OBJECT_FOREIGN_KEY + ");"; final String CREATE_OUTPUT_TABLE = "CREATE TABLE IF NOT EXISTS " + OUTPUT_TABLE + " (" + OPERATION_TABLE + " INTEGER" + ", " + OBJECT_TABLE + " INTEGER" + ", " + OPERATION_FOREIGN_KEY + ", " + OBJECT_FOREIGN_KEY + ");"; final String CREATE_CONCERNS_TABLE = "CREATE TABLE IF NOT EXISTS " + CONCERNS_TABLE + " (" + OBJECT_TABLE + " INTEGER" + ", " + GOAL_TABLE + " INTEGER" + ", " + OBJECT_FOREIGN_KEY + ", " + GOAL_FOREIGN_KEY + ");"; /* * Declaration and assignment of SQL queries for the creation of the recursive relation tables for Goal, Actor and Object (Operation has no recursive relationships) */ final String CREATE_OR_REFINEMENT_TABLE = "CREATE TABLE IF NOT EXISTS " + OR_REFINEMENT_TABLE + " (" + GOAL_OR_REFINEMENT_HIGHER_LEVEL + " INTEGER" + ", " + GOAL_OR_REFINEMENT_LOWER_LEVEL + " INTEGER" + ", " + "FOREIGN KEY (" + GOAL_OR_REFINEMENT_HIGHER_LEVEL + ")" + REFERENCE_GOAL + ", " + "FOREIGN KEY (" + GOAL_OR_REFINEMENT_LOWER_LEVEL + ")" + REFERENCE_GOAL + ");"; final String CREATE_AND_REFINEMENT_TABLE = "CREATE TABLE IF NOT EXISTS " + AND_REFINEMENT_TABLE + "(" + GOAL_AND_REFINEMENT_HIGHER_LEVEL + " INTEGER" + "," + GOAL_AND_REFINEMENT_LOWER_LEVEL + " INTEGER" + "," + "FOREIGN KEY (" + GOAL_AND_REFINEMENT_HIGHER_LEVEL + ")" + REFERENCE_GOAL + ", " + "FOREIGN KEY (" + GOAL_AND_REFINEMENT_LOWER_LEVEL + ")" + REFERENCE_GOAL + ");"; final String CREATE_SUPERVISION_TABLE = "CREATE TABLE IF NOT EXISTS " + SUPERVISION_TABLE + "(" + ACTOR_SUPERVISION_SUPERVISOR + " INTEGER" + ", " + ACTOR_SUPERVISION_SUPERVISEE + " INTEGER" + ", " + "FOREIGN KEY (" + ACTOR_SUPERVISION_SUPERVISOR + ")" + REFERENCE_ACTOR + ", " + "FOREIGN KEY (" + ACTOR_SUPERVISION_SUPERVISEE + ")" + REFERENCE_ACTOR + ");"; final String CREATE_AGGREGATION_TABLE = "CREATE TABLE IF NOT EXISTS " + AGGREGATION_TABLE OBJECT_AGGREGATION_WHOLE + " INTEGER" + ", " OBJECT_AGGREGATION_PART + " INTEGER" + ", " + "FOREIGN KEY (" + OBJECT_AGGREGATION_WHOLE + ")" + REFERENCE_OBJECT + ", " + "FOREIGN KEY (" + OBJECT_AGGREGATION_PART + ")" + REFERENCE_OBJECT + ");"; final String CREATE_SPECIALISATION_TABLE = "CREATE TABLE IF NOT EXISTS " + SPECIALISATION_TABLE OBJECT_SPECIALISATION_IS_A + " INTEGER" + ", " + OBJECT_SPECIALISATION_SPECIALISED + " INTEGER" + ", " + "FOREIGN KEY (" + OBJECT_SPECIALISATION_IS_A + ")" + REFERENCE_OBJECT + ", " + "FOREIGN KEY (" + OBJECT_SPECIALISATION_SPECIALISED + ")" + REFERENCE_OBJECT + ");"; final String CREATE_ASSOCIATION_TABLE = "CREATE TABLE IF NOT EXISTS " + ASSOCIATION_TABLE OBJECT_ASSOCIATION_OBJECT1 + " INTEGER" + ", " + OBJECT_ASSOCIATION_OBJECT2 + " INTEGER" + ", " + "FOREIGN KEY (" + OBJECT_ASSOCIATION_OBJECT1 + ")" + REFERENCE_OBJECT + ", " + "FOREIGN KEY (" + OBJECT_ASSOCIATION_OBJECT2 + ")" + REFERENCE_OBJECT + ");"; final String CREATE_COMPOSITION_TABLE = "CREATE TABLE IF NOT EXISTS " + COMPOSITION_TABLE OBJECT_COMPOSITION_WHOLE + " INTEGER" + ", " + OBJECT_COMPOSITION_PART + " INTEGER" + ", " + "FOREIGN KEY (" + OBJECT_COMPOSITION_WHOLE + ")" + REFERENCE_OBJECT + ", " + "FOREIGN KEY (" + OBJECT_COMPOSITION_PART + ")" + REFERENCE_OBJECT + ");"; db.beginTransaction(); try { db.execSQL(CREATE_GOAL_TABLE); db.execSQL(CREATE_ACTOR_TABLE); db.execSQL(CREATE_OPERATION_TABLE); db.execSQL(CREATE_OBJECT_TABLE);
Business architecture modelling in CHOOSE: a visual application for Android tablets 63
db.execSQL(CREATE_RESPONSIBILITY_TABLE); db.execSQL(CREATE_PERFORMS_TABLE); db.execSQL(CREATE_BELONGSTO_TABLE); db.execSQL(CREATE_SERVES_TABLE); db.execSQL(CREATE_INPUT_TABLE); db.execSQL(CREATE_OUTPUT_TABLE); db.execSQL(CREATE_CONCERNS_TABLE); db.execSQL(CREATE_OR_REFINEMENT_TABLE); db.execSQL(CREATE_AND_REFINEMENT_TABLE); db.execSQL(CREATE_SUPERVISION_TABLE); db.execSQL(CREATE_AGGREGATION_TABLE); db.execSQL(CREATE_SPECIALISATION_TABLE); db.execSQL(CREATE_ASSOCIATION_TABLE); db.execSQL(CREATE_COMPOSITION_TABLE); /* * TODO delete dummy data insert */ insertDummyData(db); } catch (SQLException e) { // TODO Auto-generated catch block e.printStackTrace(); } finally { db.setTransactionSuccessful(); } db.endTransaction(); } private void insertDummyData(SQLiteDatabase db) { for (int i = 0; i < 10; i++){ ContentValues goalValues = new ContentValues(); goalValues.put(GOAL_NAME, "testGoal" + i); goalValues.put(GOAL_DESCRIPTION, "Goal description" + i); db.insert(GOAL_TABLE, null, goalValues); ContentValues actorValues = new ContentValues(); actorValues.put(ACTOR_NAME, "testActor" +i); actorValues.put(ACTOR_DESCRIPTION, "Actor description" + i); db.insert(ACTOR_TABLE, null, actorValues); ContentValues operationValues = new ContentValues(); operationValues.put(OPERATION_NAME, "testActor" +i); operationValues.put(OPERATION_DESCRIPTION, "Operation description"+i); db.insert(ACTOR_TABLE, null, operationValues); ContentValues objectValues = new ContentValues(); objectValues.put(OBJECT_NAME, "testObject" + i); objectValues.put(OBJECT_DESCRIPTION, "Object description" + i); db.insert(OBJECT_TABLE, null, objectValues); } } @Override public void onUpgrade(SQLiteDatabase db, int oldVersion, int newVersion) { } } }
Business architecture modelling in CHOOSE: a visual application for Android tablets 64
Appendix 2: GraphProvider implementation
package data; import android.content.ContentProvider; import android.content.ContentValues; import android.content.Context; import android.content.UriMatcher; import android.database.Cursor; import android.database.SQLException; import android.database.sqlite.SQLiteDatabase; import android.database.sqlite.SQLiteOpenHelper; import android.database.sqlite.SQLiteQueryBuilder; import android.net.Uri; import android.util.Log; public class GraphProvider extends ContentProvider { /* * Declaration and assignment of table and column names */ private static final String NODE_TABLE = "Node"; public static final String NODE_ID = "_id"; public static final String NODE_NAME = "name"; public static final String NODE_DESCRIPTION = "description"; public static final String NODE_TYPE = "type"; public static final String NODE_X = "x"; public static final String NODE_Y = "y"; private static final String ARC_TABLE = "Arc"; public static final String ARC_FROM = "fromNode"; public static final String ARC_TO = "toNode"; public static final String ARC_TYPE = "type"; private static final String AUTHORITY = "Graph"; public static final Uri NODE_URI = Uri.parse("content://" + AUTHORITY + "/" + NODE_TABLE); public static final Uri ARC_URI = Uri.parse("content://" + AUTHORITY + "/" + ARC_TABLE); /* * Declaration and assignment of Uri codes */ private static final int NODE = 100; private static final int ARC = 200; ChooseDatabaseHelper chooseDatabaseHelper; SQLiteDatabase db; @Override public boolean onCreate() { chooseDatabaseHelper = new ChooseDatabaseHelper(getContext()); return false; } @Override public Uri insert(Uri uri, ContentValues values) { String table = getTable(uri); db = chooseDatabaseHelper.getWritableDatabase(); Long id = db.insert(table, "null", values); getContext().getContentResolver().notifyChange(uri, null); Log.i("GraphProvider", table + " successfully added: " + values.toString() + " id=" + id.toString()); return uri; } @Override public Cursor query(Uri uri, String[] projection, String selection, String[] selectionArgs, String sortOrder) { String table = getTable(uri); db = chooseDatabaseHelper.getReadableDatabase(); SQLiteQueryBuilder queryBuilder = new SQLiteQueryBuilder();
Business architecture modelling in CHOOSE: a visual application for Android tablets 65
queryBuilder.setTables(table); Cursor cursor = queryBuilder.query(db, projection, selection, selectionArgs, null, null, sortOrder); cursor.setNotificationUri(getContext().getContentResolver(), uri); return cursor; } @Override public int update(Uri uri, ContentValues values, String whereClause, String[] whereArgs) { String table = getTable(uri); db = chooseDatabaseHelper.getWritableDatabase(); int affectedRows = db.update(table, values, whereClause, whereArgs); getContext().getContentResolver().notifyChange(uri, null); return affectedRows; } @Override public int delete(Uri uri, String whereClause, String[] whereArgs) { String table = getTable(uri); int affectedRows = 0; db = chooseDatabaseHelper.getWritableDatabase(); affectedRows = db.delete(table, whereClause, whereArgs); getContext().getContentResolver().notifyChange(uri, null); return affectedRows; } @Override public String getType(Uri uri) { return null; } private static final UriMatcher sURIMatcher = new UriMatcher(UriMatcher.NO_MATCH); static { sURIMatcher.addURI(AUTHORITY, NODE_TABLE, NODE); sURIMatcher.addURI(AUTHORITY, ARC_TABLE, ARC); } private String getTable(Uri uri) { int uriType = sURIMatcher.match(uri); switch (uriType){ case -1: throw new IllegalArgumentException("Unknown URI (uriMatcher cannot find URI) " + uri + uriType); case NODE: return NODE_TABLE; case ARC: return ARC_TABLE; } return null; } private class ChooseDatabaseHelper extends SQLiteOpenHelper { /* * Declaration and assignment of database properties */ private static final String DATABASE_NAME = "GraphDatabase"; private static final int DATABASE_VERSION = 1; ChooseDatabaseHelper(Context context) { super(context, DATABASE_NAME, null, DATABASE_VERSION); }
Business architecture modelling in CHOOSE: a visual application for Android tablets 66
@Override public void onOpen(SQLiteDatabase db) { super.onOpen(db); if (!db.isReadOnly()) { // Enable foreign key constraints db.execSQL("PRAGMA foreign_keys=ON;"); } } @Override public void onCreate(SQLiteDatabase db) { final String CREATE_NODE_TABLE = "CREATE TABLE IF NOT EXISTS " + NODE_TABLE + " (" + NODE_ID + " INTEGER PRIMARY KEY AUTOINCREMENT" + ", " + NODE_TYPE + " TEXT" + ", " + NODE_NAME + " TEXT" + ", " + NODE_DESCRIPTION + " TEXT" + ", " + NODE_X + " INTEGER" + ", " + NODE_Y + " INTEGER" + ");"; final String CREATE_ARC_TABLE = "CREATE TABLE IF NOT EXISTS " + ARC_TABLE + " (" + ARC_FROM + " INTEGER " + ", " + ARC_TO + " INTEGER " + ", " + ARC_TYPE + " TEXT" + ", " + "FOREIGN KEY (" + ARC_FROM + ") REFERENCES " + NODE_TABLE + "(" + NODE_ID + ")" + " ON DELETE CASCADE," + "FOREIGN KEY (" + ARC_TO + ") REFERENCES " + NODE_TABLE + "(" + NODE_ID + ")" + " ON DELETE CASCADE);"; db.beginTransaction(); try { db.execSQL(CREATE_NODE_TABLE); db.execSQL(CREATE_ARC_TABLE); } catch (SQLException e) { // TODO Auto-generated catch block e.printStackTrace(); } finally { db.setTransactionSuccessful(); } db.endTransaction(); } @Override public void onUpgrade(SQLiteDatabase db, int oldVersion, int newVersion) { } } }
Business architecture modelling in CHOOSE: a visual application for Android tablets 67
Appendix 3: The InfiniteScrollView class
package util; import android.content.Context; import android.graphics.Canvas; import android.graphics.Color; import android.graphics.Paint; import android.view.MotionEvent; import android.view.ScaleGestureDetector; import android.view.View; public abstract class InfiniteScrollView extends View { protected final float MIN_ZOOM = 0.1f; protected final float MAX_ZOOM = 5f; protected float scaleFactor = 1f; protected float focusPointX = 0; protected float focusPointY = 0; protected int totalOffsetX = 0; protected int totalOffsetY = 0; protected boolean scrollable = true; protected Context context; private ScaleGestureDetector detector; public InfiniteScrollView(Context context) { super(context); this.context = context; detector = new ScaleGestureDetector(context, new ScaleListener()); } private class ScaleListener extends ScaleGestureDetector.SimpleOnScaleGestureListener { @Override public boolean onScale(ScaleGestureDetector detector) { scaleFactor *= detector.getScaleFactor(); scaleFactor = scaleFactor > MAX_ZOOM ? MAX_ZOOM : (scaleFactor < MIN_ZOOM ? MIN_ZOOM : scaleFactor); focusPointX = detector.getFocusX(); focusPointY = detector.getFocusY(); invalidate(); return true; } } Paint paint = new Paint(); @Override public void onDraw(Canvas canvas) { super.onDraw(canvas); canvas.scale(scaleFactor, scaleFactor, focusPointX, focusPointY); canvas.translate(totalOffsetX, totalOffsetY); centerOrigin(canvas); paint.setColor(Color.BLACK); } private void centerOrigin(Canvas canvas) { canvas.translate(this.getWidth() / 2, this.getHeight() / 2); } private int touchStartPositionX = 0; private int touchStartPositionY = 0; private int savedTotalOffsetX = 0; private int savedTotalOffsetY = 0; @Override public boolean onTouchEvent(MotionEvent event) {
Business architecture modelling in CHOOSE: a visual application for Android tablets 68
detector.onTouchEvent(event); if (scrollable) { scroll(event); } return false; } private void scroll(MotionEvent event) { int action = event.getAction(); switch (action) { case MotionEvent.ACTION_DOWN: touchStartPositionX = (int) event.getRawX(); touchStartPositionY = (int) event.getRawY(); break; case MotionEvent.ACTION_MOVE: totalOffsetX = (int) (savedTotalOffsetX + (((int) event.getRawX() - touchStartPositionX) / scaleFactor)); totalOffsetY = (int) (savedTotalOffsetY + (((int) event.getRawY() - touchStartPositionY) / scaleFactor)); this.invalidate(); break; case MotionEvent.ACTION_UP: case MotionEvent.ACTION_CANCEL: savedTotalOffsetX = totalOffsetX; savedTotalOffsetY = totalOffsetY; break; default: break; } } public void setScrollable(boolean scrollable) { this.scrollable = scrollable; } }
Business architecture modelling in CHOOSE: a visual application for Android tablets 69
Appendix 4: Drawing behaviour of the composition relationship
package Visualization; import model.ArcDrawBehavior; import model.DrawableNode; import util.GeoMath; import android.graphics.Canvas; import android.graphics.Color; import android.graphics.Matrix; import android.graphics.Paint; import android.graphics.Path; import android.graphics.Point; public class CompositionDrawBehavior implements ArcDrawBehavior { private State state; DrawableNode fromNode; DrawableNode toNode; Point fromPosition; Point centerPosition; Point intersectionPoint; Point toPosition; Canvas canvas; public void draw(Canvas canvas, DrawableNode fromNode, DrawableNode toNode) { this.canvas = canvas; this.fromNode = fromNode; this.toNode = toNode; fromPosition = fromNode.getPosition(); toPosition = toNode.getPosition(); centerPosition = GeoMath.getCenter(fromPosition, toPosition); intersectionPoint = getIntersectionPoint(); drawLine(); drawArrow(); } private void drawLine() { Paint paint = new Paint(); paint.setStrokeWidth(5); // TODO constant paint.setColor(Color.BLACK); paint.setAntiAlias(true); Point stopLineSegmentPoint = new Point(); int lengtOfCoveredSegment = 20; // TODO constant double multiplyingFactor = 1-(lengtOfCoveredSegment/(GeoMath.getDistance(fromPosition, intersectionPoint))); stopLineSegmentPoint.x = (int) (fromPosition.x + multiplyingFactor*(intersectionPoint.x - fromPosition.x)); stopLineSegmentPoint.y = (int) (fromPosition.y + multiplyingFactor*(intersectionPoint.y - fromPosition.y)); canvas.drawLine(fromPosition.x, fromPosition.y, stopLineSegmentPoint.x, stopLineSegmentPoint.y, paint); } private void drawArrow() { Paint shapePaint = new Paint(); shapePaint.setColor(Color.BLACK); shapePaint.setAntiAlias(true); Path path = new Path();
Business architecture modelling in CHOOSE: a visual application for Android tablets 70
path.moveTo(intersectionPoint.x, intersectionPoint.y); path.lineTo(intersectionPoint.x+10, intersectionPoint.y+15); path.lineTo(intersectionPoint.x, intersectionPoint.y+30); path.lineTo(intersectionPoint.x-10, intersectionPoint.y+15); path.close(); if ((toPosition.x-fromPosition.x) != 0){ Matrix matrix = new Matrix(); float arcSlope = (float) (toPosition.y-fromPosition.y)/(toPosition.x-fromPosition.x); if (fromPosition.x > toPosition.x){ matrix.setRotate((float) (Math.atan(arcSlope)*180/Math.PI+270), intersectionPoint.x, intersectionPoint.y); } else { matrix.setRotate((float) (Math.atan(arcSlope)*180/Math.PI+90), intersectionPoint.x, intersectionPoint.y); } path.transform(matrix); } canvas.drawPath(path, shapePaint); } private Point getIntersectionPoint() { ObjectDrawBehavior objectDrawBehavior = (ObjectDrawBehavior) toNode.getNodeDrawBehavior(); Point position = objectDrawBehavior.getPosition(); int width = objectDrawBehavior.getWidth(); int height = objectDrawBehavior.getHeight(); Point bottomLeft = new Point(position.x-width/2, position.y+height/2); Point bottomRight = new Point(position.x+width/2, position.y+height/2); Point topRight = new Point(position.x+width/2, position.y-height/2); Point topLeft = new Point(position.x-width/2, position.y-height/2); Point[] intersectionPoints = new Point[4]; intersectionPoints[0] = GeoMath.intersectionPointOfLineSegments(fromPosition, toPosition, bottomLeft, bottomRight); intersectionPoints[1] = GeoMath.intersectionPointOfLineSegments(fromPosition, toPosition, bottomRight, topRight); intersectionPoints[2] = GeoMath.intersectionPointOfLineSegments(fromPosition, toPosition, topRight, topLeft); intersectionPoints[3] = GeoMath.intersectionPointOfLineSegments(fromPosition, toPosition, topLeft, bottomLeft); Point intersectionPoint = new Point(); double distance = Double.MAX_VALUE; for (int i = 0; i < 4; i++){ if (intersectionPoints[i] != null){ double tempDistance = GeoMath.getDistance(fromNode.getPosition(), intersectionPoints[i]); if (tempDistance < distance){ distance = tempDistance; intersectionPoint = intersectionPoints[i]; } } } return intersectionPoint; } public void setState(State state) { this.state = state; } }
Business architecture modelling in CHOOSE: a visual application for Android tablets 71
Appendix 5: Implementation of the force-based algorithm
public static DrawableGraph forceBasedDrawing(DrawableGraph drawableGraph){ List<DrawableNode> nodes = drawableGraph.getNodes(); List<DrawableArc> arcs = drawableGraph.getArcs(); int iterations = 1; for (int i = 0; i < iterations; i++){ for (DrawableNode node : nodes){ Vector netForce = new Vector(0,0); for (DrawableNode otherNode : nodes){ if (otherNode.getId() != node.getId()){ netForce.add(coulombRepulsion(node, otherNode)); } } for (DrawableArc arc : arcs){ if (arc.getFromNode().getId() == node.getId()){ netForce.add(hookeAttraction(node, arc.getToNode())); } else if (arc.getToNode().getId() == node.getId()){ netForce.add(hookeAttraction(node, arc.getFromNode())); } } node.getVelocity().add(netForce).multiply(0.8); node.getPosition().x += node.getVelocity().x; node.getPosition().y += node.getVelocity().y; } } return drawableGraph; } private static Vector hookeAttraction(DrawableNode node, DrawableNode otherNode) { double springConstant = 0.05; double springLength = 200; Vector subtracted = new Vector(node.getPosition().x - otherNode.getPosition().x, node.getPosition().y - otherNode.getPosition().y); Vector spring = new Vector(subtracted.x, subtracted.y).multiply(springLength/subtracted.length()); Vector hookeAttraction = subtracted.subtract(spring).multiply(-1).multiply(springConstant); return hookeAttraction; } private static Vector coulombRepulsion(DrawableNode node, DrawableNode otherNode) { double coulombConstant = 300; Vector nodeVector = new Vector(node.getPosition().x, node.getPosition().y); Vector otherNodeVector = new Vector(otherNode.getPosition().x, otherNode.getPosition().y); Vector subtracted = nodeVector.subtract(otherNodeVector); double length = subtracted.length(); Vector coulombRepulsion = subtracted.divide(length).multiply(coulombConstant/length); return coulombRepulsion; }
Business architecture modelling in CHOOSE: a visual application for Android tablets 72
Appendix 6: CD with source code, installation file and software project
Business architecture modelling in CHOOSE: a visual application for Android tablets 73